UITabBar在顶部或其他?
我是新来的swift,将创build一个用户界面,其中显示一个tabor,当我通过苹果的人机界面的指导方针 ,他们说,不使用UITabBar顶部。 我们可以通过自定义来使用它,但是很多人在App Store中提交时会被拒绝。
所以,而不是UITabar应该使用顶部的标签?
您应该在导航栏中使用分段控件,如本例中的iOS人机界面指南所示:
https://developer.apple.com/ios/human-interface-guidelines/ui-controls/segmented-controls/
可能吗? 当然,但是这违反了人机界面指南。
Swift版本
import UIKit class TabViewController: UITabBarController, UITabBarControllerDelegate { override func viewDidLoad() { super.viewDidLoad() self.delegate = self // Do any additional setup after loading the view. } override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() self.tabBar.invalidateIntrinsicContentSize() var tabSize: CGFloat = 44.0 let orientation = UIApplication.sharedApplication().statusBarOrientation if UIInterfaceOrientationIsLandscape(orientation) { tabSize = 32.0; } var tabFrame = self.tabBar.frame tabFrame.size.height = tabSize tabFrame.origin.y = self.view.frame.origin.y self.tabBar.frame = tabFrame self.tabBar.translucent = false self.tabBar.translucent = true } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
- Google Maps iOS SDK崩溃
- 用drawRect设置UIView backgroundColor:
- UIDocumentPickerViewController中的iOS自定义UTI initWithDocumentTypes
- 即使userInteractionEnabled设置为NO,UITextField也会显示光标
- 不build议使用iOS5 NSURLConnection方法
- iOS应用测试。 应用安装失败。 未找到代码签名
- RevMob sdk 5.9.0在导入<RevMobAds / RevMobAds.h>时给头文件带来了错误
- 在keychain / userdefaults中保存atomic属性是否有优势?
- 拉伸的形状,以适应框架?