【代码笔记】iOS-UIActionSheet字体的修改
2024-09-21 20:52:36
一,效果图。
二,代码。
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]; }
}
}
最新文章
- windows qt 编译 boost 添加 路径
- JS中new都是干了些什么事情
- android4.x获取(也可监测)外置sd路径和读写
- 算法导论_ch2
- Localdb Attach Problem
- Hadoop安装(2)安装hadoop 前的centos 设置
- FastDFS的学习与使用(大量帖子)
- spring多数据源的配置(转)
- OSG(OpenSceneGraphcow.osg)配置笔记
- 关于flex4 list 高度适应内容
- 从parcel.js打包出错,到拥抱nvm
- TF.learn学习
- angularjs html 转义
- Axure RP 8 软件介绍
- 报表工具-ECharts 特性介绍
- mui getJSON实现jsonp跨域
- babel(一)
- (转)HTTPS到底是个啥玩意儿?
- Python 合并两个列表的多种方式,合并两个字典的多种方式
- 自动化jenkins报:ModuleNotFoundError: No module named &#39;common&#39;
热门文章
- Liferay7 BPM门户开发之2: BPMN 2.0 规范入门 (Activiti BPMN extensions)
- 开发ASP.NET MVC 在线录音录像(音视频录制并上传)
- 56.storm 之 hello world (集群模式)
- Ubuntu 14.04TLS和CentOS-6(64bit)上安装Nginx
- ScreenOper
- MVC3学习:利用jquery+ajax生成二维码(支持中文)
- Android的Fragment的第一种声明方式
- TCP保活的必要性
- Java配置分离之Spring远程配置
- Ubuntu中安装Sublime Text 3并安装Package Control