UIAppearanceプロトコル
アピアランスの変更を行います。
準拠 | NSObject |
フレームワーク | /System/Library/Frameworks/UIKit.framework |
使用可能 | iOS 5.0以降 |
定義 | UIAppearance.h |
概要
アピアランスの変更を行います。
クラスに対して変更を行うことができるので、以降作成するオブジェクトに対して変更されたアピアランスが適用されます。(+ appearanceWhenContainedIn:)メソッドでは、あるオブジェクトに含まれる場合のみアピアランスを変更する、といったことが行えます。
アピアランスが適用されるのはaddSubview:で追加される時です。
#pragma mark UIAppearance appearance: - (IBAction)button002:(id)sender { //UIActivityIndicatorViewのアピアランス id aiAppearance = [UIActivityIndicatorView appearance]; //UIButtonのアピアランス id buttonAppearance = [UIButton appearance]; //UIActivityIndicatorViewのカラーをグリーンに [aiAppearance setColor:[UIColor greenColor]]; //UIButtonのバックグラウンドカラーをグリーンに [buttonAppearance setBackgroundColor:[UIColor greenColor]]; }
メソッドとプロパティ
アピアランスの変更
フレームワーク
UIKit
クラス
UIAppearance
参照
- 作者: 加藤寛人,藤川宏之,高丘知央,西方夏子,吉田悠一,関川雄介,丸山弘詩
- 出版社/メーカー: インプレスジャパン
- 発売日: 2013/04/04
- メディア: 単行本(ソフトカバー)
- クリック: 14回
- この商品を含むブログ (2件) を見る