xcode - iPhone SDK: How can I add a scroll view to my application? -


I am creating an application for the iPhone that has a button that animate an image view , I have created another scene in which buttons are organized, although I want to be able to make horizontal or vertical, scroll this view of the buttons I have seen to add scroll view and I have also followed a tutorial, But i do not know this Education how it can add to my app. Any idea anyone? In the tutorial, I add that man to the scroll bar in the main window. XB, now my app has been created and designed in Design Controller. ACB. So after following the tutorial, when I affect the build and load it, that nibb and whatever you see is a white background and a scroll view. (In that tutorial, he scrolled an image, where I want to scroll a long view of the buttons) I know that the navy of my question may be crazy, but I'm new to all programming at once. Here's another question, if someone helps me to work with this scroll view, then you design the content of the scrolled scene, if this length is higher than the iPhone screen? Because it is my understanding that the interface with the interface builder is the size of the iPhone screen and now the interface designing is not enabled in comparison to the iPhone screen. (Of course I know that it is Do-Power, I do not know how to do this) Any help would be appreciated.

You can set the content view (scrolling area) dimensions programmatically:

  [scrollView setContentSize: CGSizeMake (contentViewWidth, contentViewHeight)];  

And after you use the coordinate system of the content view, you see the components in the scroll view. So say that your scroll view was 100x100 pixels and you want to see the scroll view twice as detailed: scrollView set contents: CGSizeMake (200.0f, 100.0f)];

Then you can add a button to appear on each half of the scroll view:

  // First part of the Content View button 1. Frame.origin X = 10.0f; Button1 .frame.origin.y = 50.0f; [Scrollweedseeview view: button1]; // First section of the Content View button 2 .frame.origin.x = 110.0f; // Note that the 110 button is outside of 2. Frame.origin.y = 50.0f; // scroll view frame [scrollView addSubView: button2];  

You can design each page of the scroll view as a separate sub-view in the NIB and then sub-subtitle to the right page location either interface builder or programmatically - But I have never tried it If it works then you will be able to move your button using IB.

I would be interested to know that it works.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -