c# - String padding not taking up the same character spacing -


i using padding in uitableviewsource format cell. have:

//cell declared somewhere in `uitableviewsource` 

var name = rows[indexpath.row].machinename.padright(50);

i have tried well:

var name = rows[indexpath.row].machinename.padright(50, ' ');

i have set cell text:

cell.textlabel.text = "01234567" + " " + name + "01234567";

the output looks like:

01234567 somenamehere           01234567 ------------------------------------------- 01234567 somenamehere           01234567 -------------------------------------------- 01234567 someothernamehere         01234567 -------------------------------------------- 01234567 shortname            01234567 --------------------------------------------- 

i have checked length of name , of them 50 when shown on device in cell doesn't line up. there special xamarin, ios, uitableviewcell - may different.

my work around create uitableviewcell using xcode nice if work.

try:

var name = rows[indexpath.row].machinename.padright(10, '\t'); 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -