相关疑难解决方法(0)

编译适用于iOS 6和iOS 7的应用程序

我正在努力编译一个iPad应用程序,以便在iOS 6和iOS 7上使用.

这是我一直得到的信息:

Property 'barTintColor' not found on object of type 'UITabBar *'; did you mean 'tintColor'?
Run Code Online (Sandbox Code Playgroud)

Base SDK目标设定为Latest iOS (iOS 7.0),且iOS Deployment TargetiOS 6.0.我在项目上做了一个Clean.

Xcode目标设置

这是代码:

在.h文件中:

@property (nonatomic, strong) IBOutlet UITabBar *tabbedBar;
Run Code Online (Sandbox Code Playgroud)

在.m文件中:

if ([tabbedBar respondsToSelector: @selector(barTintColor)]) {
     tabbedBar.barTintColor = [UIColor blackColor];
}
Run Code Online (Sandbox Code Playgroud)

我正在编译iOS 7 SDK,所以它应该知道barTintColor.知道问题可能是什么?

更新:

好的,我正在取得进展,但不太明白为什么.

看到这个Xcode截图.请注意Active Scheme选择中我的iPad 3的两个条目.有什么不同?如果我选择顶部选项,我会收到错误.如果我选择底部选项,它可以工作.

Xcode设备选择

任何人都可以解释为什么同一设备在此列表中出现两次,以及为什么它在我选择一个而不是另一个时有效?仅供参考,该设备已安装iOS 6.

xcode uikit ipad ios ios7

11
推荐指数
1
解决办法
8486
查看次数

在UITableView中的Section Header中添加填充

我创建了这个标题标题,不幸的是我不知道如何在右侧添加一些填充.

截图

这是我的代码:

override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
    let title: UILabel = UILabel()
    title.text = "Days"
    title.backgroundColor = UIColor.lightGrayColor()
    title.textAlignment = NSTextAlignment.Right
    return title
}
Run Code Online (Sandbox Code Playgroud)

header uitableview ios swift

3
推荐指数
1
解决办法
5248
查看次数

标签 统计

ios ×2

header ×1

ios7 ×1

ipad ×1

swift ×1

uikit ×1

uitableview ×1

xcode ×1