我正在开发一个包含UITableView的应用程序.用户唯一需要的是重新排序UITableView的内容.在编辑模式下,tableview单元格的背景颜色变为透明.在重新排序时,有没有办法保持tableview单元格的原始背景颜色?
解:
经过几次额外搜索后,我找到了(简单)解决方案.通过将cell.backgroundView.backgroundcolor添加到willDisplayCell方法,问题得以解决.
我正在使用自定义UINavigationBar的选项卡式应用程序.每当我在iOS模拟器中打开控制中心时,Xcode中的命令行都会给我以下错误:
CGImageCreate:无效的图像大小0 x 0.
它出现在每个ViewController中,即使是空的.
这可能与自定义UINavigationBar或TabBar有关吗?
这是我用于标签栏的appdelegate.m文件中的代码
DMFirstViewController *firstViewController = [[DMFirstViewController alloc] init];
DMSecViewController *secondViewController = [[DMSecViewController alloc] init];
DMThirdViewController *thirdViewController = [[DMThirdViewController alloc] init];
DMFourthViewController *fourthViewController = [[DMFourthViewController alloc] init];
tabController = [[UITabBarController alloc] init];
NSArray* controllers = [NSArray arrayWithObjects:firstViewController, secondViewController, thirdViewController, fourthViewController, nil];
tabController.viewControllers = controllers;
UIImage *unselectedTabFirst = [UIImage imageNamed:@"first_line.png"];
UIImage *selectedTabFirst = [UIImage imageNamed:@"first_active.png"];
UIImage *unselectedTabSec = [UIImage imageNamed:@"second_line.png"];
UIImage *selectedTabSec = [UIImage imageNamed:@"second_active.png"];
UIImage *unselectedTabThird = [UIImage imageNamed:@"third_line.png"];
UIImage *selectedTabThird = [UIImage imageNamed:@"third_active.png"];
UIImage *unselectedTabFourth …Run Code Online (Sandbox Code Playgroud)