Post

Replies

Boosts

Views

Activity

Reply to Using UIButtonConfiguration, what is the equivalent to using UIButton.imageEdgeInsets
Thanks for answering! I have another question, In this code https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/autofill/form_input_accessory/branding_view_controller.mm;l=141?q=branding_view_controller, the image associated (the first logo above the keyboard) looks bigger. Would you happen to know possible reasons why the scaling would be different? I already checked the image scale and size and found that they were 3 and 24x24 respectively. So not sure why when using UIButtonConfiguration the scale looks like 3 but without UIButtonConfiguration the scale looks like 2 but says 3.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’23
Reply to UIButtonConfiguration Help
Also I'm having an issue with this code UIButton *mixedButton = [UIButton buttonWithType:UIButtonTypeSystem]; [self updateButton:mixedButton withFloat:420]; mixedButton.configuration = [UIButtonConfiguration plainButtonConfiguration]; [mixedButton setImage:[UIImage imageNamed:@"Tweet"] forState:UIControlStateNormal]; mixedButton.tintColor = [UIColor redColor]; [self.view addSubview:mixedButton]; How come the tint color doesn't affect the image set when there's a configuration set? From what I read, old methods and properties should override configuration changes.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’23
Reply to UIButtonConfiguration Help
Even in this example of a sample project @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self.view setBackgroundColor:[UIColor whiteColor]]; UIButton *legacyButton = [[UIButton alloc] init]; [self updateButton:legacyButton withFloat:210]; [self.view addSubview:legacyButton]; UIButtonConfiguration* buttonConfiguration = [UIButtonConfiguration plainButtonConfiguration]; UIButton *configButton = [UIButton buttonWithConfiguration:buttonConfiguration primaryAction:nil]; [self updateButton:configButton withFloat:260]; [self.view addSubview:configButton]; UIButton *mixedButton = [[UIButton alloc] init]; [self updateButton:mixedButton withFloat:310]; mixedButton.configuration = [UIButtonConfiguration plainButtonConfiguration]; [self.view addSubview:mixedButton]; } - (void) updateButton:(UIButton*)button withFloat: (CGFloat)yAxis { button.titleLabel.font = [[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline] fontWithSize:17.0]; [button setBackgroundColor:[UIColor blueColor]]; [button setTitle:@"Legacy" forState:UIControlStateNormal]; button.frame = CGRectMake(80.0, yAxis, 160.0, 40.0); } @end You will notice that the UILabel doesn't respect the boundaries of the UIButton. Please help
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’23
Reply to UIButtonConfiguration Help
Can we possibly remove the deprecation warning since UIButtonConfiguration doesn't have the full functionality required to migrate over from the legacy UIButton system? LineBreakMode wasn't even added until recently in iOS 16.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’23
Reply to UIButtonConfiguration Help
Here's a link to the code I'm trying to work with https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/cells/price_notifications_track_button.mm;l=26-61?q=price_notifications_track_button. Specifically, I'm trying to deprecate the legacy UIButton system and replace it with UIButtonConfiguration.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’23
Reply to How To Set Number Of Lines in UIButtonConfiguration
Doesn't that just break the line up with the delimiter "\n"? My question was if we could do something similar to UILabel.numberofLines = 0.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to When using UIButton.Configuration it's impossible to limit number of lines of the button's title label
Bumping this up, I think this is still an issue. Is there any way around this? If we use attributedString, how do set number of lines?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to Follow Up: Replacement for adjustsImageWhenHighlighted in UIButton
Gotcha, thanks!
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to Replacement for adjustsImageWhenHighlighted in UIButton
What would be the equivalent refactor if we want to adjustsImageWhenHighlighted to be NO?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Using UIButtonConfiguration, what is the equivalent to using UIButton.imageEdgeInsets
Nevermind, I was told that the screenshot on the left is intended. Thanks! Marking resolved.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Using UIButtonConfiguration, what is the equivalent to using UIButton.imageEdgeInsets
Image of the comment above
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Using UIButtonConfiguration, what is the equivalent to using UIButton.imageEdgeInsets
Thanks for answering! I have another question, In this code https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/autofill/form_input_accessory/branding_view_controller.mm;l=141?q=branding_view_controller, the image associated (the first logo above the keyboard) looks bigger. Would you happen to know possible reasons why the scaling would be different? I already checked the image scale and size and found that they were 3 and 24x24 respectively. So not sure why when using UIButtonConfiguration the scale looks like 3 but without UIButtonConfiguration the scale looks like 2 but says 3.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to UIButtonConfiguration Help
Also I'm having an issue with this code UIButton *mixedButton = [UIButton buttonWithType:UIButtonTypeSystem]; [self updateButton:mixedButton withFloat:420]; mixedButton.configuration = [UIButtonConfiguration plainButtonConfiguration]; [mixedButton setImage:[UIImage imageNamed:@"Tweet"] forState:UIControlStateNormal]; mixedButton.tintColor = [UIColor redColor]; [self.view addSubview:mixedButton]; How come the tint color doesn't affect the image set when there's a configuration set? From what I read, old methods and properties should override configuration changes.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to UIButtonConfiguration Help
Even in this example of a sample project @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self.view setBackgroundColor:[UIColor whiteColor]]; UIButton *legacyButton = [[UIButton alloc] init]; [self updateButton:legacyButton withFloat:210]; [self.view addSubview:legacyButton]; UIButtonConfiguration* buttonConfiguration = [UIButtonConfiguration plainButtonConfiguration]; UIButton *configButton = [UIButton buttonWithConfiguration:buttonConfiguration primaryAction:nil]; [self updateButton:configButton withFloat:260]; [self.view addSubview:configButton]; UIButton *mixedButton = [[UIButton alloc] init]; [self updateButton:mixedButton withFloat:310]; mixedButton.configuration = [UIButtonConfiguration plainButtonConfiguration]; [self.view addSubview:mixedButton]; } - (void) updateButton:(UIButton*)button withFloat: (CGFloat)yAxis { button.titleLabel.font = [[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline] fontWithSize:17.0]; [button setBackgroundColor:[UIColor blueColor]]; [button setTitle:@"Legacy" forState:UIControlStateNormal]; button.frame = CGRectMake(80.0, yAxis, 160.0, 40.0); } @end You will notice that the UILabel doesn't respect the boundaries of the UIButton. Please help
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to UIButtonConfiguration Help
Can we possibly remove the deprecation warning since UIButtonConfiguration doesn't have the full functionality required to migrate over from the legacy UIButton system? LineBreakMode wasn't even added until recently in iOS 16.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to UIButtonConfiguration Help
This issue isn't resolved, I just hit the solve button by accident and can't remove it
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to UIButtonConfiguration Help
Here's a link to the code I'm trying to work with https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/cells/price_notifications_track_button.mm;l=26-61?q=price_notifications_track_button. Specifically, I'm trying to deprecate the legacy UIButton system and replace it with UIButtonConfiguration.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23