IOS-Tips

1.解决webView加载html选择本地相册出现退出界面问题

需要重写dismissViewControllerAnimated方法进行判断,如果是模态出来的界面,则不退出。

//_flag   操作完成标记可以退出界面
-(void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion
{
    if (self.presentedViewController)
    {
        [super dismissViewControllerAnimated:flag completion:completion];
    }
    if (_flag) {
        [super dismissViewControllerAnimated:flag completion:completion];
    }
   
}

2.解决labe右边出现一颗线

labe出现一颗线的情况原因:frame的宽高没有取整,或者说上下左右边没有取整
解决方法:在取frame得时候,加上CGRectIntegral,使得宽、高得到一个整数,然后就完美的解决这个问题了
修改前: label.frame =CGRectMake(x, y, w, H);
修改后: label.frame = CGRectIntegral(CGRectMake(x, y, W, H));

3.刷新单行跳动问题

加上 performWithoutAnimation

 [UIView performWithoutAnimation:^{
     [self.tableView reloadSection:section.integerValue withRowAnimation:UITableViewRowAnimationAutomatic];
       }];

你可能感兴趣的:(IOS-Tips)