ios - Best way to add a toolbar with a button at the bottom of a table? -


What is the best way to add a toolbar that does not scroll under the table?

I have a table of names that is selectable. I want to see a toolbar (not necessarily UITullbar) at the bottom of the screen where users can press a button. I want the toolbar to be always there and do not scroll with the table and always stay down.

Here's a solution to this question.

  + (zero) Show toolbar: (UITableView *) TableviewBase {UIView * parentView = tableViewObj.superview; CGRect Frame, Stay; CGRCTDWide (Parent Weave Bound, End Frame, and Stay, 44, CGRTMXAge); Frame.origin.y = frame.origin.y + 5 .; Frame.ize.height = frame.edame.height-12.; UIToolbar * toolbar = [[Uitoolbar alloc] initWithFrame: frame]; [[Uitoolbar appearance] setBackgroundColor: [UIColor colorWithRed: (245 / 255.0) Green: (130 / 255.0) Blue: (32 / 255.0) Alpha: 1.0]]; toolbar.barTintColor = [UIColor colorWithRed: (245 / 255.0) Green: (130 / 255.0) Blue: (32 / 255.0) Alpha: 1.0]; toolbar.translucent = no; [Toolbar Settint Color: [UIColor whiteColor]]; UIBarButtonItem * button1 = [[UIBarButtonItem alloc] initWithTitle: @ "Sorted" style: UIBarButtonItemStylePlain Target: Self-action: zero]; // [[UIBarButtonItem presence] setTitlePositionAdjustment: UIOffsetMakeBarMetrics for (10, -5): UIBarMetricsDefault]; UIBarButtonItem * spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemFlexibleSpace Target: Self-action: Zero]; UIBarButtonItem * button2 = [[UIBarButtonItem alloc] initWithTitle: @ "Categories" style: UIBarButtonItemStylePlain Target: Self-action: zero]; UIBarButtonItem * button3 = [[UIBarButtonItem alloc] initWithTitle: @ "Filter" style: UIBarButtonItemStylePlain Goal: self action: zero]; [Toolbar set item: [[NSARROOOC] Initwith objects: spacer, button 1, spacer, button 2, spacer, button3, spacer, zero]]; [Toolbar setautorizingmask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin]; [TableViewObj.superview addSubview: toolbar]; // Add Button Floating X = toolbar between Harisantangal line. Frame EyesWith / 3; // BUTTON1 UIView * b1View = [[UIView alloc] initWithFrame: CGRectMake (x-1, 0, 1, 44)]; b1View.backgroundColor = [UIColor whiteColor]; [Add toolbarviewviewview: b1 view]; // BUTTON2 UIView * b2View = [[UIView alloc] initWithFrame: CGRectMake (x * 2, 0, 1, 44)]; b2View.backgroundColor = [UIColor whiteColor]; [Add toolbarviewviewview: b2 view]; }    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -