iOS Question Button Design

Allan Cameron

Member
Licensed User
Longtime User
Erel--How do I set the button text color in code? There does not seem to be a .TextColor setting. Also, is there a way to have multi-line text on a button?

Thanks

Allan
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Allan Cameron

Member
Licensed User
Longtime User
Erel--Thanks again for your help. I have been putting labels of different lengths on buttons (in different languages) and this has sorted out the problem I was experiencing.
 
Upvote 0
D

Deleted member 103

Guest

TextAlignment=ALIGNMENT_CENTER
B4X:
Sub SetMultiline(b As Button)
    Dim no As NativeObject = b
    no.GetField("titleLabel").SetField("numberOfLines", 0)
    no.GetField("titleLabel").SetField("textAlignment", 1)
End Sub

Declaration
Objective-C

enum { NSTextAlignmentLeft = 0, NSTextAlignmentCenter = 1, NSTextAlignmentRight = 2, NSTextAlignmentJustified = 3, NSTextAlignmentNatural = 4, }; typedef NSInteger NSTextAlignment;
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…