iOS Question Change the font size of SegmentedControl?

BensonHung

Member
Licensed User
Longtime User
thanks JanPRO
I test it, and the result as following:

B4X:
Dim NaObj As NativeObject = Me
NaObj.RunMethod("SetFont::",Array(Font.CreateNew(16),SCTotalResult))

Method not found: SetFont::, target: <b4i_userindexmodule: (null)>

2015/10/20 PM8:42
I know my question!!

I am missing↓

B4X:
#If OBJC
-(void)SetFont:(UIFont *)Font :(UISegmentedControl *)SegmentedControl{
    NSDictionary *attributes = [NSDictionary dictionaryWithObject:Font forKey:NSFontAttributeName];
    [SegmentedControl setTitleTextAttributes:attributes forState:UIControlStateNormal];
}                            
#End If
 
Last edited:
Upvote 0

JanPRO

Well-Known Member
Licensed User
Longtime User
Probably you have forgot to set the Objc code:

B4X:
#If OBJC
-(void)SetFont:(UIFont *)Font :(UISegmentedControl *)SegmentedControl{
    NSDictionary *attributes = [NSDictionary dictionaryWithObject:Font forKey:NSFontAttributeName];
    [SegmentedControl setTitleTextAttributes:attributes forState:UIControlStateNormal];
}                           
#End If
 
Upvote 0
Top