不常用的知识点总结

本文汇总了iOS开发中的一些实用技巧,包括如何访问静态库支持的架构、访问公共成员变量、取消执行的方法、隐藏TableView多余的横线等。同时介绍了如何调整UITableViewCell内元素的位置、通过点击视图关闭键盘以及更改TableView中Cell的选中状态等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

查看静态库支持的架构


访问公共的成员变量(@plblic声明的)

@public

float height;

访问: stu->height = 10;

+方法,取消将要执行的方法

[NSObjectcancelPreviousPerformRequestsWithTarget:selfselector:@selector(aaa:)object:nil];

隐藏tableview多余的横线

self.tableView.tableFooterView = [[UIView alloc] init]; 

怎么在不新建一个Cell的情况下调整separaLine的位置?
_myTableView.separatorInset = UIEdgeInsetsMake(0, 100, 0, 0);

怎么点击self.view就让键盘收起,需要添加一个tapGestures?

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event2{
[self.view endEditing:YES];

怎么把tableviewcell的小对勾的颜色改成别的颜色?
_mTableView.tintColor = [UIColor redColor]; 


怎么改变uitextfield placeholder的颜色和位置?继承uitextfield,重写这个方法

- (void) drawPlaceholderInRect:(CGRect)rect {
    [[UIColor blueColor] setFill];
    [self.placeholder drawInRect:rect withFont:self.font lineBreakMode:UILineBreakModeT

/// 取消tableview选中

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

    [tableView deselectRowAtIndexPath:indexPathanimated:NO];

}

获取当前app版本号

[[[NSBundlemainBundle] infoDictionary]objectForKey:@"CFBundleShortVersionString"]]

定时器停止 

[_timersetFireDate:[NSDatedistantFuture]];

定时器启动

[_timersetFireDate:[NSDatedistantPast]];



//防止屏幕暗掉锁屏

[[UIApplication sharedApplication] setIdleTimerDisabled:YES];


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值