ios - UITextView vs UILabel: With respect to line-spacing -
so have uiview
subview uilabel
@ top, static text , minimum scale (to deal 4" vs 6 twins).
under that, have 3 lines of text static string.
under that, have button custom border, corner radius.
i had issue size , spacing. 4" screen, want line spacing 0 uilabel
, uibutton
have same spacing between top , bottom of view.
with 6/6+ screen, want line spacing 1.5~2.0:
with uitextview
, disable user interaction , scrolling, set font properties in ib , in viewcontroller
, override layoutmanager/linespacingafterglyphatindex
conditional operator :ui_user_interface_idiom
, mainscreen bounds check height of screen , return float based on 4"/4.7"/5.5" screen sizes.
it works great, looks great, has no interaction problems.
but coworker insistent should using uilabel
line count, because it's static text , shame on me using uitextview
.
is there programmatic systematic reason should using uilabel
instead of uitextview
? , no, i'm not looking canned copy/pasted "uilabel
static text , uitextview
text wish edit blah blah". want know actual fundamental differences when textview has user interaction properties disabled purpose of overriding line spacing.
non editable text can displayed in uilabel if want edit text user input/ scrolling feature can use textview.
if want user select text displayed on ui; can go textview. uilabel doesn't support selecting , copy.
uilabel derived uiview uitextview derived uiscrollview. inherit properties of scrollview well. uitextview conforms protocol keyboard handlings
Comments
Post a Comment