UITableViewCell
アプリストアアプリのように、タイトルの右に「すべて見る>」ボタンを追加するにはどうすればよいですか?
3 に答える
0
ボタン (およびヘッダー タイトル) をカスタムUIView
に追加し、それをテーブル ヘッダーとして追加できます (-[UITableView
tableHeaderView]
于 2014-06-27T12:04:53.337 に答える
0
UIButton
カスタム UITableViewCell にドラッグするだけです。そのUIButton
外観スタイルをカスタマイズして、コンテンツ テキストに「See All>」と記述します。.h ファイルにボタン プロパティのリンクを作成し、 delegate メソッドCustomCell
のボタンに targetSelector を追加します。例のために-cellForRowAtIndexPathMethod
UITableView
[seeAllBtn addTarget:self action:@selector(seeAllAction:) forControlEvents:UIControlEventTouchUpInside];
owner
のコントローラーにこのメソッドを実装することを忘れないでくださいUITableView
。
于 2014-06-27T12:05:37.657 に答える
0
そんな感じ :
UIBarButtonItem *button = [[UIBarButtonItem alloc] init];
[button setTitle:@"See all"];
[self.navigationItem setRightBarButtonItem:button];
于 2014-06-27T11:58:07.483 に答える