iPhone : Layer.zPosition issue - iphone

Hope someone can help me out here.
I have a viewcontroller with view that contains a red image. This image has a zPosition of 1.
There a function I press and it adds a new view on top of this (and viewcontroller). that places a button on top of the red bar with a zPosition of 2.
Then when you press the button, a 3rd view (and controller) slides up a menu behind both of them (image and button) as it has a zPosition of 0.
Now the issue is that the menu slides up under the red bar as expected however for some unknown reason (why I am here) the button seems to be under the red image. What every I try, I cant get the button to sit on top of the image.
I have tried:
propertyViewController.shortlistButton.layer.zPosition = 2;
[propertyViewController.view bringSubviewToFront:propertyViewController.shortlistButton];
propertyViewController.shortlistButton.layer.transform = CATransform3DMakeTranslation(1, 1, 1);
(stackoverflow post)

You could simply try adding the red button as a subview of red image.

Related

UIScrollView with UIImageView gesture click only work on first visible images

I have UIScrollView and I add few UIImageView, it's comment ViewController and click on images only work for first two images or for only images which are visible when scroll Y = 0. Even if image is half visible when scroll Y = 0 then first half of image click works and second half when you try to click nothing happen. Any explanation?
I resolve it by implementing touch position on scroll and I handle click on image if it's clicked on image ...

View's origin confuse my project

I got a project ( I' ve already finished it ) I did a uialert view into. When I started my app and pressed the alert view button, the alert view came from the top, not from the middle of the screen. I set the view s origin s to the middle, and it s worked, but if went into a subview and after backed to the start view, the alert view came again from the top left.
Then I set my view s origin back to the top left, and it s still works the same wrong mode( app start: okey, after go into subview and back it s wrong) .
If I start my app,and just tap the alert button it works fine ( appears from the middle with the right animation ), after I go any subview , it s confuse, and I got a uitextfield, and map too in my subviews. If I click into the textfield, the "|" symbol to start writing, comes from the top left, and if I want to zoom in my text for just correct it, the loupe comes from the top left too, and it s really annoying. And if I watch the map, and there is a pin, and during the zooming in or out the pin disappears, when I stop it, it comes from the top left, or bottom right.
I don t know how to fix this problem, my mind is blowing.
I tried to fix it with code:
skroller.layer.anchorPoint = CGPointMake(0.5, 0.5);
levels.layer.anchorPoint = CGPointMake(0.5, 0.5);
but it still works wrong
If I click on the view , and show the size inspector it doesn t look like this:
image
I don t see the Autosize, and example, and arrange. If I click on for example to attributes inspector it appeard for 0.00001 sec .

issue occurs when doing in LandscapeLeft

I am working to support the rotation screen in Iphone now and running into the issue. When the screen is in Poitrait mode, the position of navigation bar and its items on it looks perfectly.
When I switch to LandscapeToLeft, the width of navigation bar is stretched and it is fine.However, the position of items bar on it stay the same...Their positions are not changed at all.Therefore, there are huge room from the rightmost button to a right margin. ...I cant not attach any images so that you guys can easily see it....Sorry about that
If you were experiencing it before, please help
Any ideas are welcomed here. Thanks
PS: these itemBarButton are added by drag and drop in the toolbar in StoryBoard
Take a look at adding a "Fixed Space Bar Button Item" or "Flexible Space Bar Button Item". You can drag them into the navigation bar from the object library.

Disclosure indicator moves slightly when 'edit' is pressed with grouped UITableView

I've changed my UITableView to be grouped in Interface Builder (which looks so much nicer!), but now the Disclosure Indicator against my UITableView row moves a few pixels up and right whenever I press my edit button in my navigation bar (at the same time as the red delete buttons move in)!
Has anyone seen this before or got any suggestions?
Edit:
Ive added a screen shot to this question. While it is very hard to notice even on these large screen shots, the chevron in the upper right corner of the second picture is a few pixels up and right of the chevron on the first picture. This is obviously more apparent when it moves in front of your eyes. On the second picture, the edit button has been pressed (which you can tell, because the delete icon has appeared)

UIToolbar and Flexable/Fixed bar button items

I have a toolbar, where I want to have one UIBarButtonItem centered and have another on the very right. However when I add the button on the right, my centered button gets shifted further to the left (see attached). I can't figure out how to get this resolved without using code (I would like to use interface builder only). Any ideas?
To do this in just IB, add a fixed bar button item to the very left of the bar that's the exact same width of the 'switch camera' button, followed by a flexible button, your camera icon, another flexible space, and the switch camera.
So it would look like:
|--fixed space--||--flexible space--||Camera Button||--flexible space--||switch camera|