I am attempting to upgrade a client to iOS7 but am having trouble with the accessoryType. As you can see here, when I launch in standard portrait mode it looks fine (the green background is something I applied to demonstrate how the UIViews are resizing):
As you can see the chevron is properly right-aligned. Now, if I rotate the device:
The chevron does not properly align itself at the right-edge of the screen. I tried applying an autoresizing mask to the accessory view, and about 10 other things, to no avail.
When I launch in iPad mode the chevron does not right align either in portrait or landscape mode.
I am setting this chevron by doing the following in the constructor of a custom UITableViewCell:
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator
Note that scrolling the cells completely off the screen, then letting them fall back on-screen, causes the chevron to draw correctly right-aligned.
Can anyone suggest how to right-align chevrons properly in iOS7?
Figured it out -- it's because I stupidly forgot to include a call to [super layoutSubviews] in my override of
- (void) layoutSubviews
Problem solved!
Related
I have some UIButtons that when shows in portrait look like this
When I rotate the device to landscape, I want the label to be underneath the image.
I've seen this answer to getting the label beneath the button image - Label under image in UIButton but can't figure out how and where to implement this on device rotation that is safe.
My view hierarchy for this section looks like this with the UIScrollView as subview of the main UIView
I am targeting iOS 8 and using AutoLayout. I have seen some answers using layoutSubviews for other questions that do something similar but I've seen that layoutSubviews will be called on each rotation. I need this to only happen on landscape layouts.
I am having issues with a specific view on my storyboard. The button and textview don't show in the right place when using the ipad. It works perfect for the iPhone, however. I am using one storyboard for the both of them. (Not one each) Here is a screenshot for what it is showing and the blue rect is for where the textview should be and the red is for where the GPS button, which is visible to the left, should show. Any ideas? I have tried setting and reseting the constraints, but it has had zero effect.
Thanks
I am attempting to create a custom popover for an iPad application in landscape orientation. I created a new UITableViewController with static cells on my storyboard and set the size setting to "free form". I then set the size of the UITableView to my desired size. I connected a Modal segue from the parent controller to the new popover.
Then in the parent UIViewController I created a method that performs the segue through a custom presenter. After working through a bug in Apple's orientation handling routines, I got the popover to show at the correct location.
When I run the app, I then discovered that in the top right hand corner of the UITableView a white box is displayed that covers whatever I place in the UITableViewCell. The more cells I place in the table the longer this white box appears. So I believe it has something to do with the UITableViewCell not orienting properly although I have not figured out what yet.
I cannot seem to find what this box is, nor have I had any luck getting rid of it. Has anyone seen something like this? Any help to get this white box remove (or whatever is needed to get the cells working correctly again), will be greatly appreciated.
Thanks in advance
For anyone who is interested, I was able to work around this problem. It turns out that there is a bug in the modal segue logic that does not handle landscape orientation. So I created a XIB and presented that as my modal view. I still need to adjust things since it is landscape but the view displays correctly.
From what I understand this storyboard bug should be fixed soon.
so basically, for reasons in this answer ive put a UIView inside a webview so that it acts as a header to the view. its works perfectly for ipad, but on iphone when the webview is rotated landscape, the header UIView isnt clickable.
ive tried in the - (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation to explicitly set the userInteraction = true of the header view but this didnt work.
i tried removing it from the superview and adding it back, but to no avail.
i have some debug code that lets me see the class of the view im clicking on, and when i click on the header view i can see its clicking on the scrollview behind it (which is part of the webview). so it just seems to be ignoring the view completely (even though it works in portrait mode, and works in landscape and portrait on ipad).
does anyone know why the click events are going straight though the uiview?
update:
something interesting ive found is that if the webview doesnt resize when the view rotates, then the header is still clickable, so it must be something to do with the resizing of the webview screwing things up
also, the background from the scrollview is like coming through the header view it seems (header = grey, scrollview = yellow) pics here. when rotated back to portrait the grey shows up again and is clickable
Give the scroll view a background color to see where it is. If the button is outside of the scroll view it is still visible (if clipsToBounds is NO, which it is by default) but not clickable.
Find out where the superview of the button is and make the resizing in a way that it is big enough after resizing.
strangest solution, but instead of having the header view autoresize in all directions, i set it like so
something strange must have been happening and making its frame set wrong somehow
I developed iPad tabbar application. I also use custom tabbar on left side. Bu Tab bar has white background along edges in landscape mode and also portrait mode. This area could not delete any of the method.
It sounds like the sizes you're using in your nib file don't match the layout in your app. You'll need to set the autoresizing mask of your views so that they resize correctly at runtime.
You can change the autoresizing masks in the nib by opening the right-hand pane; selecting the icon that looks a bit like a ruler, and then clicking the red arrows. Here's a picture:
The important arrows are the ones in the second row; click them so they look like this:
Your view should then resize correctly.