ios - Position text in a textfield -
i position text in textfield more specifically.
my current code:
uitextfield * textfieldindustry = [[uitextfield alloc] initwithframe:cgrectmake(10, 10, 465, 68)]; textfieldindustry.font = [uifont systemfontofsize:17.0]; textfieldindustry.placeholder = @"tap to.."; textfieldindustry.textalignment = nstextalignmentcenter;
this code:
textfieldindustry.textalignment = nstextalignmentcenter;
centers text not want it. how position using example x & y?
you cannot set position of text implicitly in uitextfield without subclassing it.
you can use uitextview instead, , should use same approach it:
uitextview *textview; uiedgeinsets insets = uiedgeinsetsmake(top, left, bottom, right); [textview setcontentinset:insets];
you can use this approach subclassing uitextfield.
Comments
Post a Comment