Oritentation issue in landscape (iphone) - iphone

Good day!
I have a view which i forcefully landscape. but the problem which i am facing is that the navigation bar buttons are somewhere else but i have to click few steps (inches) back to let it act. e.g.
if button is at frame
0,0 then i have to click at 50,0 to go back. i am attaching screenshot, if some one could help me in this. Please help
Thanks & Regards

Without providing the code (or the entire project), it is unlikely for anyone to tell you exactly what is wrong.
...Unless this is just a frame/bounds issue. Make sure they are set to the proper values. The frame is the area where your view is displayed, and the bounds is the area where your view will accept interaction.

How did you force the screen in landscape? The usual way is something like the following (in any UIViewController subclass):
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
If you forced it any other way, that might be the cause of your issue.

This may cause due to no Auto resizing You will only have to do is goto Layout in Interface Builder then Live Auto resizing.
OR
By selecting all the components one by one hit cmd+3 Then there is a panel named autoresizing only select lines in inner square and deselect outer one if any
Only then your missing block will be shown and no button problem will be there
Cheers

Related

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

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

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.

How to re-arrange UI Elements when screen is rotated

I am building an iphone app that has a small button at the right corner of the screen. Ideally, I should be able to see the button no matter what orientation I hold the phone. However, for now I can only see the button when the screen is upright/vertical, when I turn it sideways, the button is not visible.
What is the easiest way to solve this problem? Can I move the button manually when I rotate the screen ( this may be easier since the button is the only IB OUlet that is not showing up correctly, other elements are fine).
Or I thought of making two different views with two different nib files. ( But I am not sure how to do that?)
Please help. Thanks
in interface builder, you should be able to specify which corner the button should stick to, in the button's properties.
that's the easiest way. if you have a more complex interface then you'd need to either write code to move the button, or as you say, create a new view for the "other" orientation.
Redrawing the frame of the buttons in willRotateToInterfaceOrientation fixes the issue. or for just rotating and make use of autoresizingmask

Problem autosizing second view

Once a view is called from appdelegate, it is properly loaded but not autosized correctly, on the bottom you see last lines from previous view! On xib file, view mode property is set to scale to fill but I tried others and still happening the same... Thanks for any idea to solve it!
Maybe check Interface Builder, is the view using any of the Simulated User Interface Elements? That isn't directly answering your question but it might be worth a look, e.g. the status bar is normally simulated by default.
The standart way to control autosizing is by
self.View.autoresizingMask = UIViewAutoresizingFlexibleHeight(or st. else)
self.View.autoresizesSubviews = YES;
You might also try to just set the size manually

UIPageControl render quirk with UIScrollView

I'm building an iPhone application and like most I am trying to implement a UIScrollView with a UIPageControl, however I am coming across a very quirky behavior, which I assume may be a bug. Hopefully one of you has seen this before because it is driving me nuts.
Basically, the page control works fine, everything is hooked up and works normally on all accounts EXCEPT, with certain placements of the UIPageControl within the UIView, the UIPageControl will cease to render.
I'll just take screenshots of the XIB window to help illustrate... here's a placement that works perfectly fine:
http://www.jasconi.us/prob1.png
The UIPageControl is placed physically above the UIScrollView. Works great, everything is visible and working.
The next two DO NOT work:
http://www.jasconi.us/prob2.png
http://www.jasconi.us/prob3.png
The first one is simply placed below the scroll view. Doesn't render at all.
The second one is placed above the scroll view without technically being inside of it. Also doesn't render.
What the hell is up with this? I've tried using
[[self view] bringSubviewToFront:pageControl];
...to no avail.
Any ideas?
OK I found the answer to this, it's a little six degrees of Kevin Bacon.
This isn't actually a software bug, but a XIB quirk, for some reason the lower placement of the page control in combination with the default settings for autosize and anchor seem to jettison the control into outer space.
If you turn off all auto-scaling and auto-sizing and auto-anchoring and all that other crap, the controls appear exactly as you expected. The fact that it appears reliably when placed above the ScrollView is an oddity.
shrug.
Hope this helps future iPhone initiates.
Did you check to make sure that numberOfPages is not 0?
If you set a breakpoint can you see that pageControl is not nil?
I was still encountering this exact same problem, even after trying everyone's posted answers. My issue ended up being a little more "DOH":
I was using UIPageControl at the bottom of a modal FormSheet, however, I forgot to set the size of the view as Form Sheet in the xib. This caused my page control to be off the screen and never visible.
Moral: set view size (Full, Form, Page, etc) in your xib on the base view.
This will sound like a real no brainer, but I got caught out by it.
By default, UIPageControl expects to be on a dark background. IE: The dots are light gray, and white for the current page.
I used UIPageControl on it's own with no scrollview to change the time range of a graph I was rendering with drawRect:
Long story short, the graph background was white, so the page controller worked, I just couldn't see it. The solution was putting the graph itself in a subview, and making the parent that contained the page control have a dark background.