環境
- Xcode6.1
UINavigationControllerに設定したUIViewControllerの操作
1.ナビゲーションバーを非表示
self.navigationController!.setNavigationBarHidden(true, animated: false)
2.背景色の設定
self.view.backgroundColor = UIColor.blackColor()
ボタンを画像にする
// カスタム
var button = UIButton.buttonWithType(.Custom) as UIButton
button.frame = CGRectMake(20, 250, self.view.bounds.width - 40, 150);
button.enabled = true
// 画像の指定
button.setImage(UIImage(named: "test"), forState: .Normal)
// actionの指定
button.addTarget(self, action: "test", forControlEvents: UIControlEvents.TouchUpInside)
以上。
0 件のコメント:
コメントを投稿