iOS中 UIActionSheet字體的修改
更新時間:2017年06月19日 11:05:45 作者:弦外雨
這篇文章主要介紹了iOS中 UIActionSheet字體的修改,需要的朋友可以參考下
一,效果圖。

二,代碼。
RootViewController.h
#import <UIKit/UIKit.h>
@interface RootViewController : UIViewController
<UIActionSheetDelegate>
@end
RootViewController.m
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UIActionSheet *actionSheet=[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"手機(jī)找回密碼", nil];
[actionSheet showInView:self.view];
}
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
switch (buttonIndex) {
case 0:
{
NSLog(@"--0--");
}
break;
case 1:
{
NSLog(@"--1--");
}
break;
default:
break;
}
}
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet
{
for (UIView *subViwe in actionSheet.subviews) {
if ([subViwe isKindOfClass:[UIButton class]]) {
UIButton *button = (UIButton*)subViwe;
button.titleLabel.font=[UIFont systemFontOfSize:15];
[button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
}
}
}
以上所述是小編給大家介紹的iOS中 UIActionSheet字體的修改,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關(guān)文章
iOS實現(xiàn)調(diào)用QQ客戶端發(fā)起臨時會話
本篇文章主要給大家詳細(xì)分析了用IOS實現(xiàn)調(diào)用QQ客戶端發(fā)起臨時會話的功能,對此有需要的朋友收藏分享下。2018-02-02
ios的collection控件的自定義布局實現(xiàn)與設(shè)計
這篇文章主要介紹了mac、iOS端支持自定義布局的collection控件的實現(xiàn)與設(shè)計,需要的朋友學(xué)習(xí)參考下吧。2017-12-12

