修改不了颜色了 结果发现kvo 的key 不对 哎 直接上代码 设置正确的属性找到对应的key  还以为iOS 11改变了方法

unsigned int count;

Ivar *ivars =  class_copyIvarList([UIAlertAction class], &count);

for (int i = 0; i < count; i++) {

Ivar ivar = ivars[i];

const char * cName =  ivar_getName(ivar);

NSString *ocName = [NSString stringWithUTF8String:cName];

NSLog(@"%@",ocName);

}

free(ivars);

function:-[ReplayTextView takePhotoClick] line:192 content:_title

function:-[ReplayTextView takePhotoClick] line:192 content:_titleTextAlignment

function:-[ReplayTextView takePhotoClick] line:192 content:_enabled

function:-[ReplayTextView takePhotoClick] line:192 content:_checked

function:-[ReplayTextView takePhotoClick] line:192 content:_isPreferred

function:-[ReplayTextView takePhotoClick] line:192 content:_imageTintColor

function:-[ReplayTextView takePhotoClick] line:192 content:_titleTextColor

function:-[ReplayTextView takePhotoClick] line:192 content:_style

function:-[ReplayTextView takePhotoClick] line:192 content:_handler

function:-[ReplayTextView takePhotoClick] line:192 content:_simpleHandler

function:-[ReplayTextView takePhotoClick] line:192 content:_image

function:-[ReplayTextView takePhotoClick] line:192 content:_shouldDismissHandler

function:-[ReplayTextView takePhotoClick] line:192 content:__descriptiveText

function:-[ReplayTextView takePhotoClick] line:192 content:_contentViewController

function:-[ReplayTextView takePhotoClick] line:192 content:_keyCommandInput

function:-[ReplayTextView takePhotoClick] line:192 content:_keyCommandModifierFlags

function:-[ReplayTextView takePhotoClick] line:192 content:__representer

function:-[ReplayTextView takePhotoClick] line:192 content:__interfaceActionRepresentation

function:-[ReplayTextView takePhotoClick] line:192 content:__alertController

UIActionSheet 设置字体颜色  因为runtime没找到相应的key 直接去设置 但是通过 _alertController 还是能再次设置  喜迎十九大,人才辈出

- (void)takePhotoClick{

NSLog(@"z选择照片");

UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:STR(@"cancel") destructiveButtonTitle:nil otherButtonTitles:STR(@"checeImgAlbum"),@"Camera ", nil];

//    [sheet setValue:[UIColor colorWithHexCode:@"FD6501"] forKey:@"_titleTextColor"];

[sheet showInView:self.view];

unsigned int count;

Ivar *ivars =  class_copyIvarList([UIActionSheet class], &count);

for (int i = 0; i < count; i++) {

Ivar ivar = ivars[i];

const char * cName =  ivar_getName(ivar);

NSString *ocName = [NSString stringWithUTF8String:cName];

NSLog(@"%@",ocName);

}

free(ivars);

//    [sheet setTintColor:[UIColor orangeColor]];

}

-(void)willPresentActionSheet:(UIActionSheet *)actionSheet

{

SEL selector = NSSelectorFromString(@"_alertController");

if ([actionSheet respondsToSelector:selector])//ios8

{

UIAlertController *alertController = [actionSheet valueForKey:@"_alertController"];

if ([alertController isKindOfClass:[UIAlertController class]])

{

alertController.view.tintColor = [UIColor colorWithHexCode:@"FD6501"];

}

}

else//ios7

{

for( UIView * subView in actionSheet.subviews )

{

if( [subView isKindOfClass:[UIButton class]] )

{

UIButton * btn = (UIButton*)subView;

[btn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];

}

}

}

}

runtime查找 UIAlertAction 的key 及 UIActionSheet 设置字体颜色的更多相关文章

  1. Latex中如何设置字体颜色(3种方式)

    Latex中如何设置字体颜色(三种方式)   1.直接使用定义好的颜色 \usepackage{color} \textcolor{red/blue/green/black/white/cyan/ma ...

  2. 如何在HTML中设置字体颜色,你知道这几种方式吗?

    color设置字体颜色 在color设置字体颜色之前,我们首先了解color在CSS中有几种取值方式,一共有4种方式,若有不全还请在评论区告知谢谢,4种方式如下: 十六进制.十进制. 英文单词.十六进 ...

  3. python设置图片背景和设置字体颜色大小

    # -*- coding: utf-8 -*- """ Created on Wed Dec 11 22:37:30 2019 @author: Dell "& ...

  4. 关于UIAlertAction如何修改sheet上的字体颜色

    相信很多程序员都会遇到需求是这样的: 但是你发现无论怎么设置cancel和Destructive都无法让红色字体移动到下面取消按钮上: 其实之前一直用错,用了ios9之前的UIActionSheet这 ...

  5. C# 控制台程序(命令行程序)设置字体颜色,窗口宽高,光标行数

    控制台程序(命令行程序)设置窗口宽度高度,如下代码: Console.WriteLine(Console.WindowHeight); Console.WriteLine(Console.Buffer ...

  6. C# 控制台程序设置字体颜色

    这几天做了个程序,程序本身很简单.大体功能是输入查询条件,从数据库里取出结果计算并显示.但是用户的要求是使用控制台(console)来实现功能.由于功能简单,程序很快就做完了,在面向用户演示程序时,突 ...

  7. android 设置字体颜色、EditText自己主动输入转换成大写字母的多种方式

    在TextView上面设置某一个字的字体颜色为指定颜色时,能够通过java类SpannableString类和Html语言来实现. (一)SpannableString类方式 private void ...

  8. wpf设置字体颜色渐变和字体阴影

    <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment=&quo ...

  9. c++控制台 设置字体颜色

    一种方法是直接在程序上方栏杆点右键,然后属性处设置 优点是设置后一劳永逸,不需要像后面方法那样要自己把设置写入程序代码内 缺点是,一旦设置了就不能再改变了,程序从头到尾都是那种设置. 第二种方法是使用 ...

随机推荐

  1. Jquery4 过滤选择器

    学习要点: 1.基本过滤器 2.内容过滤器 3.可见性过滤器 4.子元素过滤器 5.其他方法 过滤选择器简称:过滤器.它其实也是一种选择器,而这种选择器类似 CSS3里的伪类,可以让不支持 CSS3 ...

  2. hadoop 3.1.1 安装

    以下是本次搭建说使用的服务器 服务器IP分配 IP 节点名称 说明 192.168.172.130 master 主服务器 192.168.172.131 slave1 从服务器1 192.168.1 ...

  3. Graph_Master(连通分量_H_Trajan+拓扑序dp)

    Graph_Master_连通分量_H 题目描述: 一个有向图G=(V,E)称为半连通的(Semi-Connected),如果满足:?u,v∈V,满足u→v或v→u,即对于图中任意两点u,v,存在一条 ...

  4. 解决github访问慢的问题

    在windows hosts文件末尾增加以下内容 # GitHub Start 192.30.253.112 github.com 192.30.253.119 gist.github.com 151 ...

  5. layui和bootstrap 对比

    layui和bootstrap 对比 这两个都属于UI渲染框架. layui是国人开发的一套框架,2016年出来的,现在已更新到2.X版本了.比较新,轻量级,样式简单好看. bootstrap 相对来 ...

  6. [Network Architecture]Xception 论文笔记(转)

    文章来源 论文:Xception: Deep Learning with Depthwise Separable Convolutions 论文链接:https://arxiv.org/abs/161 ...

  7. maven 本地仓库的配置

    <?xml version="1.0" encoding="UTF-8"?> <!--Licensed to the Apache Softw ...

  8. 使用iview--1

    在任意一个你想创建项目的路径下 每次输入就输一致的就可以 /*************************安装选项开始****************/ 回车再次回车就如下,输入Y 继续 回车,输 ...

  9. 通栏banner自适应各个设备

    思路:图片不要设置为div的background,因为你设置了background-size,但是div的height没设置一样没用,除非你搞个js判断,动态刷新. 换一种思路,直接用<img& ...

  10. [PostgreSql]PostgreSql调用函数及用IF EXISTS判断表是否存在

    1.创建一个函数function1 -- FUNCTION: public.function1(character varying, integer) -- DROP FUNCTION public. ...