BensonHung Member Licensed User Longtime User Oct 20, 2015 #1 HI~Everyone!!! How could I change the font size of SegmentedControl?? thank you!!
JanPRO Well-Known Member Licensed User Longtime User Oct 20, 2015 #2 https://www.b4x.com/android/forum/threads/segmented-control.57390/#post-361481 Upvote 0
BensonHung Member Licensed User Longtime User Oct 20, 2015 #3 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: Oct 20, 2015 Upvote 0
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
JanPRO Well-Known Member Licensed User Longtime User Oct 20, 2015 #4 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
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
BensonHung Member Licensed User Longtime User Oct 20, 2015 #6 If I need add CRLF in SegmentedControl items? what can I do? thanks! Upvote 0
JanPRO Well-Known Member Licensed User Longtime User Oct 20, 2015 #7 You should post a new thread for that question ... Upvote 0
BensonHung Member Licensed User Longtime User Oct 20, 2015 #8 JanPRO said: You should post a new thread for that question ... Click to expand... OK~thank you!! Upvote 0