iOS中 UIActionSheet字体的修改
程序员文章站
2023-12-22 08:31:52
一,效果图。
二,代码。
rootviewcontroller.h
#import
@interface r...
一,效果图。
二,代码。
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:@"手机找回密码", 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字体的修改,希望对大家有所帮助