プロモーションを使用して iOS アプリを構築しようとしています。デフォルトのデザインでビルドを使用している限り、問題なく動作します。しかし、たとえばナビゲーションバーを好きなようにスタイルできるようにしたい (さまざまな色とさまざまな背景画像)。
プロモーションを使用してこれを行うにはどうすればよいですか?
ありがとう!
プロモーションを使用して iOS アプリを構築しようとしています。デフォルトのデザインでビルドを使用している限り、問題なく動作します。しかし、たとえばナビゲーションバーを好きなようにスタイルできるようにしたい (さまざまな色とさまざまな背景画像)。
プロモーションを使用してこれを行うにはどうすればよいですか?
ありがとう!
Teacup を使用すると、ビューを簡単にカスタマイズできます。https://github.com/rubymotion/teacup
teacup を gemfile に追加し、app/styles/appearence.rb にファイル appearence.rb を作成して、次のコードを貼り付けます。
Teacup::Appearance.new do
style UINavigationBar, {
tintColor: UIColor.blackColor
}
style UIBarButtonItem, {
tintColor: UIColor.blackColor
}
style UITableViewCell, {
layer: { # style the layer!
shadowRadius: 3
},
backgroundView: { # style the background!
backgroundColor: UIColor.blackColor
},
imageView: { # style the imageView!
contentMode: UIViewContentModeScaleAspectFill
}
}
style UISearchBar, {
tintColor: UIColor.colorWithRed(0.733, green:0.733, blue:0.733, alpha:1)
}
end
ビューをロードする前に、この行をアプリのデリゲートに追加してください
Teacup::Appearance.apply
それが役に立てば幸い。