How do I lock text fields and images in place in ios? - iphone

When I am designing the interface everything looks fine.But when I run the project some text fields move and get mixed with other text fields.Some images go down.How do I lock everything in place ,so that the gui is exactly the way I designed it

hi iOsBody there are some layout problem is bellow Tips you can set properly.
in your issue you have use UINavigationController in every viewController but when you set XIB layout you can not add this 45px UInavigationBar space in XIB that's why you facing this issue.
while you use this in ios6 You can also use AutoLayout but its some time getting Creshed in ios5 or bellow ios
So please check proparly x,y and also put calculate px of UInavigationBar or statusbar while create Interface.

You can fix property of Textfield & image. So, it'll not move anywhere & stay at their own places.
Hopefully, it will help you.
Thanks.

If your view using AutoLayout functionality than uncheck it.
see the option Use AutoLayout in your main view .

1)this will help u auto size the components

Related

UIButton images look fine in IB but get stretched when displayed on app

I'm developing an Enterprise app for tracking mileage and maintenance for company vehicles. I've added graphic buttons to snazz it up a bit. The buttons look the way they're supposed to look on the XIB in IB, and on the iPhone all other UIViews look correct, but on one particular UIView the graphic images are stretched way out of proportion vertically.
The first image below shows how it's supposed to look, with the three graphics buttons at the bottom. The second image shows how it's showing on the phone. The Help button on this screen cap shows normally, but it can't be counted on to stay that way.
It also is not consistent. Calling this view at any time may show the image stretched or it may not show an image at all. It rarely shows the image normally, like the Help button looks below.
The development phone is a 4S running 6.1.3. The views are set for the Retina 3.5 screen. XCode is the latest (whatever it is).
Again, it's only on this one view that the problem shows up. There is another UIView on the same view controller that is hidden when this UIView is shown. The button graphics on the other view look fine. All of the other views and view controllers use the same graphics on the UIButton, without any problem.
In Interface Builder (Xcode) you created the view using a 4.5-inch screen height.
But the device where you are seeing the problem is a 5-inch screen. So the view is resized to fit.
And when it does that, the autolayout constraints that Interface Builder put on those subviews take over to determine what they do. Those constraints are causing the heights to change.
No need to turn Autolayout off. Autolayout can be very useful, but it seems to enjoy randomly assigning the constraint "Align Baseline to:" to UIButtons after repositioning them.
Just select the UIButton/UIImageView in question inside Storyboard, locate the constraint "Align Baseline to:", tap the gear icon and select "Promote to User Constraint", and tap once more and select "Delete". This should solve your issue.
In response to the comments here, I will answer my own question: I turned Autolayout off for this view controller, and that fixed everything. This is the first app I have written since XCode has begun development for the iPhone 5, so I wasn't aware of the Autolayout feature. I'll need to understand how it works and why it did what it did.
Thanks for all your help!

Iphone view touch issue

I have issue with view touch in iphone in my application
the bottom part of my application do nothing like following.
This are two images so you can get the idea. i am not able to interact with this bottom part . and in all view of my application.
is anyone face this issue?
thanks in advance
Ok I solve the issue
if any one facing the same issue what i had just take care of following things:
1)Make the parent view's Autosizing property to true like this:
You can find it in size inspector.
2)For child view just do this.
self.vwTextFont.clipsToBounds=YES;
here vwTextFont is my tableview as you can see in above image in question part and its parent view is vwTabBar.
so I perform first step to vwTabBar and second step to vwTextFont.
Hope this will help.

iOS iPhone Add label and text field below tab control

I'm a beginner with iOS apps, and I inherited an app I need to make some changes to.
The main view of the app is a tab view, and we'd like to add below the tab view a box with some labels (and text). The labels shouldn't change as the tabs change.
How do I do this?
I noticed something called a SplitView, but I wasn't sure how to use it, and if it's relevant for my need.
I hope that my needs are clear enough. If anyone could make recommendations as to how to do it/point me in the direction of a tutorial, I'd be very appreciate.
Thanks in advance!
The UISplitView is only for iPads. It will not work on the iPhone as far as I know. How are you creating your UITabBar. If you do it programatically you might be able to create it like something like this:
Pseudo Code
UITabBarController *mySpecialController = [[UITabBarController alloc] initWithFrame:CGRectMake('put in coordinates here')];

Xcode 4 Interface Builder Performing Undesired Auto-resize of Controls

I'm new to Xcode, and I'm having issues with Xcode auto-resizing controls when I add them to a view. Literally every control I try to add to the view is resized to fill the entire view, and I cannot figure out how to manually resize the controls and/or disable resize to fill in the first place. How does one go about this?
Thanks for any help :)
Ah. In a fit of noobishness, I failed to realize that I was adding controls to the view controller. Whooooops.

What is the correct way to show/hide a UIScrollView?

I have an iPhone application that uses a UIScrollView to display a larger version of an image on the main screen. I am using IB to create the main screen that has text, small images, and price about a product. I have it setup to show/hide the UIScrollView if the user touches the small images. It works ok, but things are pretty messing in the IB layout. I have to put the UIScrollView over top of everything else and make it hidden by default. What I'd like to know is if there is a better way to accomplish this. Can I create a new nib and load the scroll view in it and load that nib when the users touches the small image? Should I construct the scroll view in my code and not use IB? Any input is appreciated!
Sorry if this is a newb question. I'm still learning.
Set scrollView.hidden = YES and then when tapped, set it to NO.