How to edit UIAlertAction text font size and color

后端 未结 7 923
时光取名叫无心
时光取名叫无心 2020-12-06 01:33

How to edit UIAlertAction text size and color? I have taken a UIAlertController acoording to it how to edit the size. This i smy Code



        
7条回答
  •  没有蜡笔的小新
    2020-12-06 01:54

    You can update text color using

           UIAlertAction *myGoalAction = [UIAlertAction
                                        actionWithTitle:NSLocalizedString(@"My Title", @"My Title")
                                        style:UIAlertActionStyleDefault
                                        handler:^(UIAlertAction *action)
                                        {
    
                                        }];
           [myGoalAction setValue:[UIColor greenColor] forKey:@"titleTextColor"];
    

    There is no efficient way to update font size.I will suggest you to use standard font size.

    UIAlertAction title label is private variable and not accessible directly. Label comes inside 3 level private view hierarchy. Showing logout action with bigger font make sense for app.

    There are many open source solution available.I will recommend to try this

提交回复
热议问题