cocoa touch - Create Scrolling UIToolbar -


Is it possible to make scrolling UIToolbar for an iOS device in Xcode? I'm using Xcode version 4.5 beta.

ViewController.m?
  - (zero) viewDidoadload {[Super Viewedload]; // Setup an additional after loading the view, usually from a nibb. MyScrollView.contentSize = CGSizeMake (myToolBar.frame.size.width, myToolBar.frame.size.height); }   

ViewController.h #import & lt; UIKit / UIKit.h & gt; @ Interface view controller: UIViewController {IBOutlet UICroll view * myScrollView; IBotlet YouTube * MiteLabar; IBOutlet UIBarButtonItem * toolbarItem; } @ Property (strong, non-fixed) UIWindow * window; @end

Not working: (

Yes, it can be done - just tried to do it (it's not a good UI design, but maybe it's suitable for your requests.). You must set the content to be the size of the scroll view.

Add your UIScrollView Storyboard. Add a UITolbar inside it and make it as broad as possible (possibly as compared to UIScrollView). Add whatever toolbar item you want.

Create IBOutlets for scrollviews and toolbars (and your toolbar item). Then viewViewLoad in scrollView. ContentSize Set:

  myScrollView.contentSize = CGSizeMake (myToolBar.frame.size. Width =  
  - (zero) viewDidload {{Super Viewedload]; myScrollView.contentSize = CGSizeMake (myToolBar.frame.size.width, myToolBar.frame.size.height); CGRE CT myScrollViewRect = myScrollView.frame; NSLog (@ "myScrollView% f% f% f% f", myScrollViewRect .origin.x, myScrollViewRect.origin.y, myScrollViewRect.size.width, myScrollViewRect.size.height); CGTET toolbar = myToolBar.frame; NSLog (@ "toolbarRect% f% f% f% f", toolbarct.organ.x, toolbarcut.organ.i, toolbarfixed.Size.width, toolbar.}   

me down Returns the output given. I note how extensive is with Toolbar scrollview? If you are not wide enough, then it is not going to scroll (How it can be done - there is no room to scroll).

2012-07-10 14: 29: 34.494 Junk [4275: 707] myScrollView 0.000000 605.000000 778.000000 128.000000 2012-07-10 14: 29: 34.498 Junk [4275: 707] toolbar 0.000000 52.000000 1200.000000 44.000000

Comments