How do you get the page indicator (dots) to not block the bottom of the screen. I started a basic page based app template, implemented the UIPageDataSource methods to show what page is being displayed. But its blocking the bottom of my screen. If I change the PageControl background to clear its clear but it still takes up the bottom of the screen. No view wants to overlap it. I want the PageControl to be placed anywhere, and a view under it that takes up the whole screen.
My guess is that you're using a UIPageViewController. Which pr.default includes the UIPageControl element.
If you convert your app into using a regular UIViewController and manually adds the UIPageControl in the .xib(or storyboard) implement the DataSource and Delegate protocols. Then you'll be able to move the UIPageControl anywhere on the scene of your .xib or storyboard (whatever you use).
Basically it's the same thing as when you manually adds a UITableView to an UIViewController instead of using a UITableViewController.
Related
I am currently developing as app for iPad. And I need to create a tabbar. The problem is that, for design purposes, I need the tabbar to be on the top half of the screen and not on the bottom as it is on the default tabbar controller.
Once the tabbar is on top I want that when a button is touched, the subview bellow the tab is changed. Furthermore, the subview that should be loaded was alson designed inside the storyboard. The following sketch shows what I want it to look like:
On my research I found a solution (here) for putting the tabbar on top. Now my problem is on loading a subview bellow it.
I tried it with [self.view addsubview:theNameOfTheViewCreatedINStoryboad.view] but the application simply hangs when I press the button.
I think that is because I am not specifying anywhere what should be the dimension of the new view or where on the scree should it be placed. The reason for that is because I do not know where it should be done.
Can anyone give me some lights on this matter? Is the referred approach the best one for putting a tabbar on top? How can I solve the subview problem?
Glad to see you are using a toolBar and not a tabBar. Even better would be to create a custom content view controller.
You should be looking into using containment:
UIViewController containment
How does View Controller Containment work in iOS 5?
positioning UIViewController containment children
check out the docs
I have a UITableView which is long and scrollable, also I use UINAvigationController. At the bottom of the page in the footer I plan to put a next button which will help to go next page.
The problem is "sometimes" this page may need to show some messages in html, so I must use uiwebview preferebaly at the bottom of the page just above the footer, it shouldnt get effected from scrolling.
-Can I use uitableview and uiwebview on same page? the page is already in control of a uitableview controller, so how will i control or put delegates of a uiwebview?
-Can I make this uiwebview invisible and not allocate space when there are no messages to be shown?
Yes, it's possible.
I believe the Stocks app for the iPhone utilizes multiple views with their own controllers. I think a better solution would be is to have a UIPageControl and create a UITableViewController when the UIPageControl's value changed.
If you still want to create UINavigationController, just set its rootViewController to a UITableViewController and set its toolbarHidden property to NO, the toolbar has the behavior you want, it stays fixed on the bottom of the screen, if that's what you meant. Then add the navigational buttons.
As for UIWebView's, just dynamically create it once you get an error and set its hidden property to YES. You wouldn't want to be destroying and recreating UIWebViews every time you get an error as that can be very expensive. Just create once and hide it.
So I have a UIViewController, and within that I have two views, a WebView and another view that I made (taken from this tutorial: http://www.raywenderlich.com/1768/how-to-make-a-custom-uiview-a-5-star-rating-view).
In the nib file, I have the rate view on the bottom; but when I run the simulator and go to that view, I don't want the rate view to be on the bottom ALL the time; only when I am at the bottom of the WebView.
(Sorry for not being more clear, basically the Rate View would be like a part of the WebView on the bottom, and the user would see it if they scroll to the bottom of WebView).
probably not an answer, but the easiest thing would be to incorporate that second view into the content of the web view page. If that's not possible, you could try putting the 5 star view and web view inside of a UIScrollView, but it may cause problems with event handling. Another possibility would be to try to detect when the web view scrolling reaches the bottom and then pop up the 5 star view from the bottom (from off-screen). I think that can be done since UIWebView conforms to UIScrollViewDelegate.
i'm having a real trouble with UITabBarController. I have a simple foto app, and I'm trying to simulate almost the same behaviour as the PhotoApp from the Iphone
the main view controler is the tabbar itself, i also have a NavBar and a status bar on top.
What i want is on tap to hide the bars (not with timer, just on tap).
The photo is actually an UIScroll view that zooms the photo or makes it again 1:1. that part already works,
I've tried before pushing the view to the navbar to set the hidesBottomBarWhenPushed and well it works, but i can't set a custom animation, and that's not the real problem , I can't show again the bars, they dissapear and i don't know how to reshow them, i'm sure i'm probably missing someting very obvious, but as my experience in obj C is little like half a year part time, i thought i asked here as stackoverflow seems to get the answers :)
Something to investigate: the Three20 project: http://github.com/facebook/three20 - it includes a completely clone of the photo-browsing app in component form.
But without Three20, you can't do this with a stock UINavigationController, because the UIViewController that you're using is a subview of the UINavigationController. You need to make a sibling view on another layer. To do this, make a parent UIViewController which has two subviews: your photo, and a UIToolbar. You can hide and display the UIToolbar by setting it's hidden property, and make sure it's above the photo view with [parent.view bringSubviewToFront:toolbarController] (where parent is the main UIViewController that contains both the photo view and the UIToolbar)
I have looked at the PageControl example from Apple and have an architectural requirement difference. In the example the scroll view and page control objects are at the app delegate level. This means the scroll view and page control appears on every view of the application.
However, I have a "settings" view toggled from an info button (for now) that should not have these controls displayed. Therefore, I need to move my scroll view, page control, and view controllers objects down a layer and I'm struggling with how to best do this.
For example, the primary application view consists of metals (periodic elements). From this view I need a scroll view, page control, and info button on every view descending from here. Each metal will have it's own subclass where different images, calculations, etc will be displayed but I believe I need each of these subclassed elements to share the same scroll view, page control, and viewControllers array, right? Do I need a singleton?
What you are describing is kind of like how the native Weather application works. Each time you swipe, the info light is rendered as part of the page you are viewing. However, no matter what info light you tap, when it flips over you still get the same settings. Obviously this is how Apple thinks the UI should work because they did it that way. There is no reason you can't do the same.
In this situation, you don't need to create a singleton, you can use [UIApplication sharedApplication] as your singleton to get to your custom application delegate via the delegate property.
Look at Crème where I do exactly what you describe. The main view is scrollview+pagecontrol. Upon triggering the app into settings mode, the settings panel comes up that does not have a page control.
The solution is simply that you have a simple top-level UIViewController, and you make both the scrollview and pageview children of that viewcontroller. And for settings, you animate the modal settings dialog with a flip animation into the top-level UIViewController.