objective c - Add buttons under a tableview -
I am trying to make the program a view, the result is that I want a scroll view inside the table view And I want to add some buttons below this table
I do not know how I tried to do this but it does not work:
- (zero) LoadVis [[Super LoadView]; Tableview = [[UITTviewValoc] InitVithframe: [[see self limit]) Style: UITWVstyle group []; [TableView Deliate: Self]; [Table view set data source: self]; Scrollview = [[UIScrollViewAloc] InitVithframe: [[see itself] limitations]]; // [scrollView setBackgroundColor: [UIColor blackColor]]; [Scrollview setbunsuns: yes]; DeconnectButton = [[UIButton ButtonBy Tip: UIButtonTypeRoundedRect] to maintain]; [DeconnectButton setTitle: @ "Disconnect" forState: UIControlStateNormal]; [DeconnectButton setTitleColor: [UIColor orangeColor] forState: UIControlStateNormal]; // [deconnectButton addTarget: Self-action: Action for control events: UIControlEventTouchUpInside]; DeconnectButton.frame = tableView.frame; NSLog (@ "TableViewView:% @", NSSTingFromCegas (tableviewframe)); [Add ScrollView Add: View: deconnectButton]; [Add ScrollView Subview: tableView]; [[See self] Adsview: ScrollView]; }
Am I doing wrong or wrong?
Actually I got the solution TableViewed property is named tableFooterView. You only have to:
- Add a button to this view - Set this to Finish on the table FooterView
Here is the code:
Tableview = [[UITableView alloc] initWithFrame: [[see itself] border] Style: UITableViewStyleGrouped]; [TableView Deliate: Self]; [Table view set data source: self]; // Create a UIButton (Disconnect Button) UIButton * btnDeco = [UIButtonTypeRoundedRect] with UIButton Button; BtnDeco.frame = CGRectMake (0, 0, 280, 40); [BTNDIO SETITAL: @ State for "Declanator": UICOnTolStateAnimal]; BtnDeco.backgroundColor = [UIColor clear collar]; [BTNDIO SETTELL ROLLER: [State for UICILAR ORANGE COLOR]: UIContolstadt Normal]; [BTN Dedo Ad-targeted: Action by itself: @Selector (DINNETT :) Control events: UICTROVEEVET TouchUp Inside); // Create a UIButton (replace proxy button) UIButton * btnChange = [System with UIButton Button: UIButtonTypeRoundedRect]; BtnChange.frame = CGRectMake (0, 50, 280, 40); [BTN Change Secttital: @ "Chaser Pseudo" status: UIC contrastrestormal]; BtnChange.backgroundColor = [UIColor clear collar]; [BTN ChangeTitelolar: State for [UICILAR ORANGE COLOR]: UIContolstadtAnimal]; [BTAN Change Addridge: SP Action: @Selector (Change Pidudo :) Control Events: UI ControlAnchart Inside]; // tabeview View a footer under UIView * Footer = [[UIView alloc] initWithFrame: CGRactam (20, 0, 280, 100)]; [Footerview sseviewview: btndu]; [Footerview sseviewview: btn change]; TableView.tableFooterView = Footer; [See footer]; [[See itself]] [Adsviewview: TableView];
Comments
Post a Comment