Xcode buttons/images always on top? - ios

Is there an option for a button/image to set, that it will always be shown on top? So I have 2 buttons and want to add an image. But the image covers the two buttons and I have no idea how I could get the image in the background or the buttons in the front.
BTW: I´m fairly new to xcode and programming...

Use the xCode top menu item Editor->Arrange. There you have options to handle z index for controls.

What I did was, to have two button one for the label and one for the image and when one is clicked it propagates the message to the other and does the action depending on which one was clicked.

Related

How to create stacked pagination in iOS?

How to achieve the UI as shown in the image below?
I wanted to create a form with steps, by clicking next button it will swipe and open next form and will update the number of stacked pages as shown.
For making this type of UI you need to use Background image and UIPageControl. And you have to make other UI elements like text fields and button with code. You should be careful about frames.
Finally I got the answer, and created the same UI using Koloda library in objective-c
https://github.com/wang9262/Koloda-ObjC

iOS get UINavigationBar's back button in order to set accessibility properties

I have a navigation controller stack where one of the views has a dynamic title.
The view controllers and their titles go like this:
Main --> ItemsTableView --> ItemDetails
Title:Main Title: NN Items Title: Details
Because the iOS UINavigationController sets the text of the "Back" button to be the title of the previous screen, the "Back" button on the details screen says "< NN Items" where NN is a dynamically changing number.
I'm trying to do some iOS UI automation, but the accessibility Label / ID of the back button is set by the system to it's button text. This means that the accessibility label of the back button on the details screen will change dynamically, and I can't find it from my scripts!
If I could get a reference to the UIBarButtonItem then I could easily set it's accessibilityLabel or accessibilityIdentifier from code to be a fixed string, however I can't figure out how to do this?
All of the stuff I've been able to find references setting the back button to a custom button via self.navigationItem.backBarButtonItem or similar, but when I read this property it's nil. I haven't been able to find out how to get access to the standard item without replacing it. I'd prefer not to replace the button if possible
This was bugging me as well. I've been writing Xcode 7 UI Tests and was trying to come up with a generic way of tapping on the back button without having to replace it with a custom button.
The following is how I solved this for Xcode 7 UI Tests - but you may also be able to apply this to UI Automation as well.
I discovered that (in terms of Xcode 7 UI Tests at least) the back bar button item that is created by the system consists of two buttons the entire thing is a button with an accessibility label of whatever the title of the button is, and then the arrow is also a button with an accessibility label of "Back".
Thus, as long as there aren't any other buttons on the screen that are identified as "Back", the back button can be accessed via the accessibility label of "Back". Like so in the case of UI Tests:
[[app.buttons matchingIdentifier:#"Back"] elementBoundByIndex:0]
Here I'm getting the first button that can be identified by "Back". I my case there could only ever be two such buttons - the arrow, or the whole back button itself (in the case where the back button's title is also "Back"). Since both of these buttons are essentially the same, just getting the first one it finds is sufficient.

In Xcode Interface Builder - why are the options in the Editor--->Arrange menu (containing Send to Front, Send to Back) often disabled?

What I'm trying to do is simple: bring a label in front of an image within a subview.
But all of the options for arranging are disabled/un-selectable when my label is selected. I find this happens often.
What could be the reason that I'm almost never allowed to change the z-axis of my objects in the Arrange menu? Is it a better practice to avoid this feature and set the order of views programmatically?
It can depend on how you have selected the label (similar to how the label can only be moved with the keyboard when selected in some ways).
A simple alternative is to look at the list of view in the pane on the left and to drag the views up and down to change the order.
It happens sometimes. In that situation, click the view or image you want to send back then you will see little square box at the edges of image from which you can re size your image, Just click on it once and then go to Editor > Arrange > Choose option according your need.

What UI element might this be? (Custom tab-bar?)

http://www.flickr.com/photos/fraserspeirs/4329430635/in/set-72157623224262135/
The above is a link basically showing the form fill view of the numbers app on the iPad. Any idea as to how to achieve such a functionality which sort of looks like our vanilla tabs on Chrome?
You could do it with just buttons set to Custom type and using an image for the background. Then when they are clicked, bring the specific UIView to the front.
To create the tabs from a single image use UIImage's stretchableImageWithLeftCapWidth: topCapHeight:
http://tcninja.blogspot.com/2010/09/ios-adding-stretchable-uiimage-as.html
This will let you dynamically set the image's width in a way that will use the middle of it to fill the new area rather than stretching (and warping) the outer edges.
I would have implemented this with simple UIButtons. All you need to do is to style them (pngs or whatever), and track which one is the current.

How to create the screen in optimized way?

Hello everybody I am trying to create a screen (to see the image click here)
I have set it's backround image also created required list components which are click able by extending Field class. Now my problem is I am not able to set that rounded white color as backround of the list. Please help me. And also because I am new to the blackberry please also tell me the optimized way to create this screen.
i think like this
1) header bar - create manager and embed 2 buttons and 1 label in it
2) bottom bar - create a global class that contains the buttons and define a method that responds to the click event of these buttons
call that class in this main screen
3) for middle part use a list field which is scrollable

Resources