Ipad splitView, is it possible to resize the splitView's rootController? - objective-c

Right now I have a splitview that loads PDFS to a webview. When the application is in portrait mode, the formatting is correct and it does what it needs to do. However, when I switch it to landscape mode, the pdf is too large and goes off of the right side of the screen. How would I fix this? One solution I can think of is to resize the rootView table, by making it thinner it would open up more space for the PDF. Any ideas on how to do that? or if it is even possible?
Thanks in advance!

You can't with the default SplitViewController, luckily Matt has written a pretty good one that can do stuff like that!
You can find it at GitHub: https://github.com/mattgemmell/MGSplitViewController/

Related

Custom TabBarItem menu IOS 7

I'm trying to make an UITabBarController like this:
No matter the device width (whether it is rotated or not) the buttons should not be stretched and the leftover space should be on the right side.
My questions:
Is this possible with the UITabBarController?
For the whitelines inbetween the buttons I am planning to use an unclickable UITabBarItem with an image. Is this the best way to do this?
With this tutorial that I followed I am getting this result:
2 problems here ^, whilst my background.png is 320x49, the selected image (68x49) has padding. This should not happen, both pictures have the same height?
The second problem is that the button/image has trailing space, and I want it sticked to the left side, as in my first screenshot. How would I accomplish this?
I don't expect anyone to post code, just merely a push in the right direction as I'm totally lost on this.
Check this library, you can customize the UI in interface builder with consstraints and get what you want.

iOS 7 + Auto Layout: Strange UIImageView behaviour

I've got a strange UIImageView behaviour:
I've got a UIViewController with an embedded UIImageView and a close button. Very basic stuff, done a thousand times. I didn't use Auto Layout that much in the past, but another view controller in the same Storyboard has nearly the same config and doesn't appear as strange as this specific one.
In my Storyboard the Controller looks like that:
...and on the device it looks like that:
That image is 1024x768, so it should be filled to the bounds. Content mode in the image view is Aspect fill. When i dismiss the view, i can see that the upper part of the image view must be hidden at the top with some negative Y or something.
I need Auto Layout in this storyboard, because it's an iPhone + iPad App with both orientations.
Has someone hat a behaviour like that before?
Thank you!
Edit:
Here is the layout panel:
First, get rid of the alignment constraints, they are not needed if you're already anchoring your view to every side with a set distance.
Second, check the mode property of your UIImageView in the interface builder. If the image was not big enough and you had it set for "TOP" instead of, say, "aspect fill", you'd see something like this even though the view is actually covering the whole screen.
I'm sorry that I have to say this, but it was, as you certainly thought, my own fault.
The problem was that I made a photo with the iPad, and the iPad can be used in both orientations in this app. The photo was taken and was then used for an own view that allows the user to put annotations on the image.
The image gets then saved, and that was were the problem occured: I call
UIGraphicsBeginImageContextWithOptions(self.view.frame.size, NO, 0.0);
The landscape image was now taken into a portrait frame. After adjusting this and only allowing portrait mode, everything worked well.
Thanks anyways for your answers. And sorry for asking a question when the problem was another one and my own fault.

UIAppearanceProxy background image bugs

I'm using UIAppearance selectors for UIToolBar, UINavigationController, UISegmentedControl, UIBarButtonItem etc. and I'm seeing some REALLY strange behavior occasionally.
Somehow it's almost like the UIControls reset themselves after certain actions. Here's a screenshot of what I mean. Basically it's as if they no longer have the images. If I click on the controls or rotate to reset them, they'll eventually reset but I have no idea what's causing this.
Any help is much appreciated.
Thanks in advance.

Can I change the position of the Google logo in an MKMapView?

I am making an app that has an MKMapView. I have a translucent UIToolbar on top of the MKMapView. The problem is that the Google logo is beneath it. Is there a way to show the Google logo above (in Y direction, not Z) the UIToolbar instead of beneath it?
Yes, you can. And it can even get approved by apple too.
See here:
http://nachbaur.com/blog/dealing-with-mkmapviews-google-logo-with-translucent-toolbars
And here:
http://rogchap.com/2011/06/17/mkmapview-moving-the-google-logo/
The only way would be changing size of MKMapView in the same time with MKCoordinateSpan that should compensate the amount of the map occupied by UIToolbar. If you goal is to be able to display some portion of the map beneath the toolbar, it is not feasible.
I had the same problem, worrying if it might violate terms of use. As #Black Frog recommended, you should move toolbar or resize the mapView to show Google logo. Though it makes translucent toolbar to be meaningless, it's better than making your app to be potentially rejected.
There is no Google API to move the logo. You will need to move your toolbar.
It's tricky, but it is possible. Enlarge the MKMapView.frame, so the Google logo is hidden. Apple would reject your App, so you need to add the logo again. This can be done with a png of the logo (pm me, I can send it to you). You can place this png wherever you want on the map, Apple accepts.

Use a button to change the orientation of the iPhone

Is there a way to change the orientation of the iPhone using a button?
No. flip the phone, the orientation changes. Leave it at that, or you'll ruin the integrity of the phone.
sometimes we need to show our app in the correct orientation, even if there is not direct way on doing what domness want, you can look at this SO entry and see some responses.
P.S. # domness, try to search for what you need before posting a new question.
What exactly are you trying to reorient? You can change the position of the status bar with UIApplication -setStatusBarOrientation:animated:; rearrange your UI with the proper transformations and you'll pretty much have it.
You can force an orientation change, but only using an unsupported, private API. If this is something you'd like Apple to make public, you should file an enhancement request.
This is my new account btw..
Right, I got this sorted by apply the transformations to what I wanted to show when the button was clicked. It was to show a scrollview with applied animations to objects within the scroll view.