Webview and another View within UIView - iphone

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.

Related

How to change location of PageController indicator

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.

pushViewControllerAnimated pushes ViewController over whole screen

I am trying to show a modal view controller that hovers over another viewcontroller. Now the problem is when I use pushViewControllerAnimated the view controller that gets pushed will be as big as the whole iphone screen. I just want it to be half size of the screen.
How to adjust the size?
What exactly do you mean by half size of the screen?
If you are interested in the Facebook-like side menu, have a look at:
https://github.com/Inferis/ViewDeck
or https://github.com/BenHall/ios_facebook_style_navigation
If you are interested in an alertview-like small modal view controller, you might:
Consider using an alert view and adding some subviews
Read http://devblog.bu.mp/easy-partial-screen-modals-on-ios if you really have to use an UIViewController for that, which is not recommended by Apple (http://blog.carbonfive.com/2011/03/09/abusing-uiviewcontrollers/)
Hope this helps.

UITabBarController Hide Show Bars with animation like the Photo APP

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)

Need help designing application with UIPageControl and UIScrollView

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.

Swip from one view to the next view

I have an app with two views and ViewControllers. How can I let the user swip from one view to the next view like in the homescreen or the weatherapp.
I know that there is a page control in the Interface Builder, but it is just an Indicator on what page the user is.
Thanks and sorry for my bad english!
Check out the PageControl.xcodeproj from Apple's iPhone sample code. It provides a template for doing exactly what you want.
The actual paging is done using a UIScrollView in page mode with horizontal scrolling (which is what causes the scrolling to "snap" to a page boundary).