I want to make application in which i want to make a login screen. It has button having name "Log inn with Facebook". I want font size of Facebook greater than Log in with. How can I set it in main storyboard?Can anyone plz help me?
A solution would be to have a UIView
with two different UILabel
as subviews ( your "Log in with" label and your "Facebook" label ).
Then, above this UIView
you could have a UIButton
with a white background and an alpha equal to 0.01 so the button would be touchable but invisible.
This UIButton
would be the functional part of your UI.
NSMutableAttributedString *titleText = [[NSMutableAttributedString alloc] initWithString:@"Login with Facebook"];
[yourbutton.titleLabel setFont:[UIFont boldSystemFontOfSize:14]];
// Set the font to bold from the beginning of the string to the ","
[titleText addAttributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:14] forKey:NSFontAttributeName] range:NSMakeRange(0, 10)];
// Set the attributed string as the buttons' title text
[yourbutton setAttributedTitle:titleText forState:UIControlStateNormal];
Instead of creating NSAttributedString create NSMutableAttributedString then you can just set the string like this.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.