Tips collection of iOS development

<转>UITableView当数据很少的时候,去掉多余的cell分割线

 

在tableView初始化的时候  

 UIView *v = [[UIViewallocinitWithFrame:CGRectZero];  

    [self.myTableViewsetTableFooterView:v];  

就可以了

cell 禁止选中

 

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];

<转>UIActionSheet取消按钮触摸被遮

 

UIActionSheet最后一个按钮没响应,一般是cancelButton,要稍微向上偏移一点才可以。

不过这不是常态,几乎没多少人碰到这个问题,这是在特定情况下才会发生,这个场景就是试用了UITabBar的时候才有。

参考:http://stackoverflow.com/questions/2096852/iphone-weird-bug-between-uiactionsheet-and-uitabbar

解决办法:

        UIActionSheet *action  =

        [[UIActionSheet alloc] initWithTitle:@"您是否拨打"

                                    delegate:self 

                           cancelButtonTitle:@"取消拨打"

                      destructiveButtonTitle:@"拨打" 

                           otherButtonTitles:@"加入电话本",nil];

        //[action showInView:self.view];  把这行更换为下面这个

        [action showInView:[UIApplication sharedApplication].keyWindow];

        [action release]; 

据闻是tabbar刚好在取消按钮的地方,所以离奇了,不过UIActionSheet是在tabbar上方,很难想象会出现这个问题。

原文地址:https://www.cnblogs.com/yaoliang11/p/3635292.html