How to force the .xib / view to be letterboxed on iphone 5 - iphone-5

As of May 1st, 2013 Apple is now requiring iPhone 5 support. I was hoping to appease them, by simply setting the 1136 pixel tall launch image, and then having all my views be letterboxed.
Anyone have a quick way to make all my .xib and views continue to be letterboxed on the iPhone 5, even though.

Just remove the Default.png file that has the size of the Iphone 5 width height and place the Iphone 4 size Default.png images. This will force the app to be shown letter boxed.
Also, The viceversa if you dont want to show letter boxed. i.e. stretched view for Iphone5
The best way is to use auto sizing for all the views, instead of using Auto Layout.

Related

How do I change the size of icons in Android Studio?

I'm building an app with Android Studio, and one of my activities (which lets the user draw on a canvas) has a 'toolbar', with things like 'Clear', 'Undo', 'Redo' etc.
I'm using the built-in icons for this - ie I go to the 'Drawables' folder, right-click, go to 'Add vector asset' and then select the appropriate icon. I've figured out that I can change the size of the icon that gets added, but I can't figure out how to use that.
So, on a phone screen, I'd like to use the standard 24dp icons. However, on a tablet screen, I'd like the icon to be bigger, as they're a bit lost on the bigger screen.
I can't figure out how to do this, though, and I'm not even sure whether I'm using the right approach. I know I can create different drawables sub-folders for different densities, but it's not so much the density that matters as the actual screen size.
What's the best way to go about this?
You should increase the toolbar height, the icon will fit its container automatically.
In case, if you want to change the size of the icon, double-click the xml file of the icon and change the width and height inside. Do not touch the viewportWidth and viewportHeight parameters!
In general, you should not do this, as it wouldn't follow the google guidelines.
app:itemIconsize="30dp"

Xcode 5 iOS 7 - subviews have lost positioning constraints

I was moving stuff around to get it to work in iOS 7, then the machine crashed (not unusual with a new Xcode installation). Now the subviews don't have their positioning constraints any more. Is there a way to get them back? Don't care if it's just the default constraints, right now elements are all over the place. If not, is there a way to get everything into auto layout? Some elements appear to be spring and strut aligned, others are auto layout. Probably the crash messed it up.
At the bottom of the main edit window is a toolbar with something that looks like a tie fighter.
┣●┫
Click that, then in the menu, select "Reset to Suggested Constraints".

Monotouch / iPhone 5 and developing

I am trying to write an app that I want to be compatible with the iPhone 5 and 4. I have read the excellent article Get your MonoTouch apps ready for iPhone 5 / iOS 6 today! but this implies you have to add a UIImage to each UIViewController to force it into displaying at the new resolution. It also implies I then have to do this for every UIViewController I add.
My obvious question is what happens if I don't want a background image? What if I want just a standard UITableVIew that uses the whole screen? What would happen if I want to support both resolutions I can't just put an image into the directory. How do you handle that? Is this really how Apple have designed it - you need to load a blank image?
Have I missed something really obvious? Hope so.
Thanks
Mike
To get the tall screen working on your application (for the iPhone 5 or in the iOS6 simulator) you only need to have a single Default-568h#2x.png file, of the right size, in your application.
The article you link to talks in more details about how to deal with backgrounds - but that's optional, i.e. you only need this if you have (or want) a background for your views.

Samsung Galaxy Tab 1 layout problems

I'm having trouble running my app on the Galaxy tab original 7". It appears to make everything 1.5 times bigger, i.e. if I specify 40dip for a textSize in my layout, it will display as 60 dip when I run it on the tablet.
I tried messing around with the display metrics and changing the density and densityDpi to 1. (When I run a toString of the display metrics in the Galaxy tab 2, they are both 1, whereas the Galaxy tab 1 has values of 1.5)
The app runs very well on every phone I've tested it on, and on the Galaxy tab 2, so I can't figure out what the problem is. I even tried creating a dummy app with just a textView with a size of 40dip, and it still converted it to 60.
Any ideas?
Does the answer to this question help you? Seems that he is having the same (or similar) problem.
Android layout on emulator vs device
Android, concerning the User Interface design

iOS view size and position hard-coded only?

I'm new to Macs and iOS, I got my app running on webOS, Android, and WPF/Windows. In all cases the size of, say, a 'widget' to display a bunch of text, can change depending on the dimension of the text to be displayed, as well as the position can be up against another widget. As the text size changes, the position will change so that all the widgets are crammed together nicely.
I've been searching for this capability in IOS4 in books and on-line, and it's starting to look like in iOS, you have to actually calculate the size of the text to be displayed in ViewText and then change the dimensions of ViewText, which of course then bumps other Views around to accommodate this size change. It sounds like a nightmare. Isn't there some other way to do this (like all the other GUIs can do) to size based on content, and to position relative to other Views like stacking them all together whatever size they are?
Same with ScrollView, it looks like the size of the window you actually see has to be manually specified as well, instead of, say, taking up the entire viewable window and then you can populate the ScrollView with a bunch of sub-views, some of which are below the initially viewable area? I tried this in Xcode4, but so far, haven't gotten it to work.
Similarly with creating an object with a NIB and instantiating that NIB onto an existing View, how does it determine where to position this NIB onto the existing screen?
Thanks!
Paul,
For the scrollview you need to set the bounds so it fills the screen or the area you wish it to occupy, it will then automatically generate scrollbars based on the layout within it. In the land of iOS you do have to do extensive layout work such as positioning and sizing your controls but you can also use the UIAutoResize (if I remember correctly) masks such as if they are anchored to a size, fill the area, etc. It's a little complicated to learn initially but you'll get the hang of it.
As for text you just need to use the right control, I believe what you want is a UITextView and set the options on it as needed.
When you view a XIB it's going to layout initially as you have it, again, you need to position your controls AND set their anchors (autoresize masks) so they adjust based on the screen size (phone vs. pad) and orientation: landscape vs. portrait.
HTH

Resources