プログラムの開発

iOS develop_UIButtonの一般設定

– (void)setTitle:(NSString *)title forState:(UICo […]

記事の目次

– (void)setTitle:(NSString *)title forState:(UIControlState)state;
ボタンのテキストを設定する

– (void)setTitleColor:(UIColor *)color forState:(UIControlState)state;
ボタンの文字の色を設定する

– (void)setImage:(UIImage *)image forState:(UIControlState)state;
ボタン内部の小さな写真。

– (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state;
設定ボタンの背景画像
ボタンのテキストフォントを設定する(ボタン内のラベルを取得する必要があります)。
btn. titleLabel.font = [UIFont systemFontOfSize 13];

– (NSString *)titleForState:(UIControlState)state;
ボタンのテキストを取得。

– (UIColor *)titleColorForState:(UIControlState)state;
ボタンのテキスト色を取得する

– (UIImage *)imageForState:(UIControlState)state;
ボタン内部の小さな画像を取得する

– (UIImage *)backgroundImageForState:(UIControlState)state;
ボタンの背景画像を取得