/*
UIButton の隠し API -> http://d.hatena.ne.jp/KishikawaKatsumi/20100507/1273198706
*/
// ボタンの生成
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame = CGRectMake(0, 0, 50, 30);
typedef enum {
UIButtonTypeCustom = 0,// 背景画像
UIButtonTypeRoundedRect,// 角丸
UIButtonTypeDetailDisclosure,// 詳細へ
UIButtonTypeInfoLight,// インフォ(明)
UIButtonTypeInfoDark,// インフォ(暗)
UIButtonTypeContactAdd,// 追加
} UIButtonType;
// ボタンラベル
[btn setTitle:@"タップ" forState:UIControlStateNormal];
// ボタンイベント
[btn
addTarget:self // イベント時呼び出すメソッドのあるクラス
action:@selector(btnClick:) // イベント時呼び出すメソッド
forControlEvents:UIControlEventTouchUpInside // イベント
];
最終更新:2012年10月04日 09:23