I built an iphone app and in one of the views(buit using IB), I put an activity indicator ( little spinner indicating network activity) in the middle. It works fine on my iphone but once I use an Ipad the spinner goes to the to left corner. So the spinner never correspond to the intended location on Ipad no matter where I move it in IB.
Any suggestion to solve this problem? Do I have to rebuild the app specifically for ipad?
Thanks
In Interface Builder, select the Activity Indicator and open the Size Inspector.
Default shortcut in Xcode 4 is ⌥ ⌘ 5, icon looks like a ruler.
Second section, on the left, a box labeled "Autosizing". The bars around the outside turn each anchor on or off, and the arrows inside turn autoresizing on/off for either direction (x / y)
With the indicator centered in the view, turn all four anchors on.
Solid red is on, semitransparent is off.
Related
I'm updating my app for the iPhone 5. Now I've read the topics about setting the Autosize Property and I've done that.
My question is regarding some of my elements. The interface of the app is really simple. It uses a pre-defined apple background (no custom images), and has 4 labels and a Information Button.
Two of the labels are fine but the other two and the button are aligned with the bottom of the screen, but with Auto-Sizing it creates and 1/2 inch of background between them and edge of screen.
If there any way to make them stay at the bottom of the screen like that but without having to create a whole new view for iPhone 5, with them positioned right and them programmtically select it when needed, as that is a slightly too complex way for the sake of two labels and a button.
EDITED
Here is some screenshots.
Should look like this (iPhone 4S 3.5 Inch Screen)
linky
Does look like this (iPhone 5 4 Inch Screen)
linky
To get the expected behaviour while using Autolayout, in Interface Builder, you need to select the two labels in the bottom and then go to
Editor -> Pin -> Bottom Space to Superview
This will make sure that the bottom spacing is as expected.
I'm getting my app ready for the iPhone 5 using the simulator and I've found a weird issue where a couple of my buttons, in one of my views, don't work in the iPhone (Retina 4-inch) simulator, but work fine in the iPhone (Retina 3.5-inch) simulator. The buttons simply don't do anything when they're tapped. Has anyone else experienced this issue?
I having a difficult time figuring out where to start with this one. Any suggestions on where to start?
Thanks so much in advance for all your wisdom!
You need to edit your MainWindow.xib and enable "Full Screen at Launch". For a more detailed explanation, see Apple's docs:
Important: When creating your window in Interface Builder, it is
recommended that you enable the Full Screen at Launch option in the
attributes inspector. If this option is not enabled and your window is
smaller than the screen of the target device, touch events will not be
received by some of your views. This is because windows (like all
views) do not receive touch events outside of their bounds rectangle.
Because views are not clipped to the window’s bounds by default, the
views still appear visible but events do not reach them. Enabling the
Full Screen at Launch option ensures that the window is sized
appropriately for the current screen.
Complete document from Apple
For me, the solution was to set the size ("Simulated Metrics") to "Retina 4 Full Screen" for the MainWindow.xib. I did not need to alter the size of the other screens (they are still set to None). After changing the MainWindow.xib the bottom area becomes clickable again...
The problem was caused by another control overlapping my buttons due to the way the springs and struts were setup. Adjusting the z-order of the buttons fixed the issue. Thanks, all!
There are two solution to this problem :
If you are using MainWindow follow these steps :
a. Select MainWindow.xib.
b. Select Full Screen at Launch from Windows option available in Attributes Inspector.
If your application doesn't contain MainWindow then just add:
self.view.frame = [UIScreen mainScreen].bounds
in ViewDidLoad.
I solved my prob.
view .origin for 3.5 inch and 4 inch screen are different so, when writing common code for both we need to take care at giving CGRectmake(x,y,w,h);
Set temp. diff background color of diff view so you can check if any view is overlapping or not, to fetch event in 4.0 inch.
OK here is a very basic iPad app that i am starting out with and I am already into issue. I have been doing iphone apps but in that too never implemented rotation things.. well here is the issue. This is a simple viewbased app build with interface builder that looks like this:
when i run the app, the vertical orientation has both elements like this :
However, when the orientation changes to horizontal, the app hides the label which is at the top.. :
Suggestions please !
In Interface Builder, select the label, then open the size inspector and in Autosizing section make the label stick to the upper edge of the window. You may also need to stick it to the left and/or right edge and make it change the width - depending on how you want it to be resized when orientation changes.
So I'm trying to port an existing iphone application to the ipad. When I run the targeted device set to ipad, only the top left corner of the screen is usable, (the size of the iphone). However, all table cells, objects and buttons exted out to the width of the ipad. But that area is not responsive. What am I doing wrong?
I also tried autoresizing some of the views, and even doing "upgrade current target for ipad," and selecting "two devices," though I don't know what it does. Upgrading it adds a new target, but doesn't change anything
Never mind, it's because we didn't enable full screen.
I working on a utility app. When I run the app in simulator clicking i image at the bottom flips the view in a flash. But when I run the app on iPhone device it behaves abnormally. At times it flips the view in just 1 tap. The other times it does not bother to react even after tapping the image 10 times. I tried with other utility app also - same issue. Thus its not an issue with the code I believe.
Any help to resolve this issue is much appreciated.
Thanks,
AJ
This is a problem because the 'i' button is not very big by default and touches are missed easily.
You need to put another button in front of the 'i' button with the 'Custom' type in Interface Builder, so that it doesn't have any image. Then you can make this invisible button much larger and connect it to the same action as the info button.
You also need to enable "shows touch on highlight" in Interface Builder so that you get the white glow effect when the invisible button is touched.