###前提・実現したいこと
Xcode7 Swift2にて横スワイプ型のアプリを作りはじめて1週間の者です。
デザインの都合上、UITabBarを画面の上部に表示させたく思っております。
【試行の枠組み】
TabBarのサイズと画面全体のサイズを取得後、CGRectMakeにてTabBarを移動させ、
その後コンテンツ表示部もCGRectMakeにて移動させるという枠組みで実装を考えています。
###発生している問題・エラーメッセージ
Use of unresolved identifier 'tabBarHeight' Use of unresolved identifier 'screenWidth'
###該当のソースコード
import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? struct DeviseSize { //CGRectを取得 static func bounds() ->CGRect { return UIScreen.mainScreen().bounds } //画面の横サイズを取得 static func screenWidth() ->Int { return Int(UIScreen.mainScreen().bounds.size.width) } //画面の縦サイズを取得 static func screenHeight() ->Int { return Int(UIScreen.mainScreen().bounds.size.height) } static func tabBarHeight(tabBarController: UITabBarController) -> CGFloat { return tabBarController.tabBar.frame.size.height } } func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { self.tabBarController!.tabBar.frame = CGRectMake(0.0, 20.0, screenWidth, tabBarHeight) // Override point for customization after application launch. return true }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。