How to add text under the button previously placed as leftCalloutAccessoryView of MKPinAnnotationView - objective-c

I want to basically do this: ETA info under the button with a car image
How can I add text just at the bottom of the button? Thanks in advance.

I have found the solution a long time ago but forgot to mention it here.
Here it is:
Just create a Vertical StackView, set its alignment as Center and distribution as Fill, and put your label and image in it. Make your label hidden at first. Assign the StackView as the leftCalloutAccessoryView. When you got the ETA info, just make the label unhidden inside an animation code.
That's it! It will behave just like in the Apple's Map app.

Related

iOS / Titanium: Clear Button cannot be seen on a TextField with a black background

I want to add the clear button on the TextField like so:
<TextField clearButtonMode-"Titanium.UI.INPUT_BUTTONMODE_ALWAYS" backgroundColor="black"/>
The clear button usually looks like this:
However the issue is that the background of the TextInput is black. This means the clear button cannot be seen.
How can I change the appearance or colour of the clear button so this is not an issue?
I know that it should work but if its an ti sdk issue then you should try to test it with other ti sdks.
If you find same issue then you can file a JIRA issue with test app and then you can use rightButton property to achieve what you want.
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TextField-property-rightButton
To be completely honest man. you could just add a view inside the textField. I think its bit more efficient anyways and if you code by percentages as long as your border radius is more then half the height it will be circle.

How to layout the UIlabel object according to design spec in iOS

I have some difficult time in creating iOS screen to match with visual design provided by design team.
The design team has provided the spacing info for each screen which shows how much space each text needs to be apart from other UI element on the screen. This is attached for your reference. You can see here that the two text labels "Activate Your Account" and "A Verification link...." are placed apart by 25px.
The same thing I am trying to achieve in the storyboard. I am attaching the storyboard screen snapshot for reference.
From this you can see that I cannot keep exactly 25px b/w the two text labels because for the following issue
The text font is custom font and I cannot load the same in storyboard. I have added the font file in the project, but when I try to open it in storyboard for UILabel, it doesn't list out. I am not sure why xcode doesn't show up. This makes me hard to resize the label's frame. If I try to decrease the empty space in the label (upper and lower part of the text), this will make label height less, but when I set the font programmatically, it doesn't fit in this small space.
When I try to increase the height of the label, the text inside the label starts displaying at the center leaving space at the top and bottom of the label frame.
So I want to know how to solve this problem. If anyone had this issues and sorted out, please let me know how to fix this.
Many Thanks
Your designers aren't speccing their designs correctly :) Show them how iOS renders text and have them spec their designs in the same way. This is what we do on the Facebook design team. I mocked up an example for you (each square is 4dp/8px).
http://i.stack.imgur.com/q4tZX.png

checkbox at the center of a NScheckboxcell

I am unable to center a checkbox inside a checkbox cell. Tried programmatically and over IB but without luck.
To reproduce add a NSTableView and in this add a NSCheckboxCell. edit the text of the checkbox to an empty text. Now try to center the box with the alignment button inside the cell. it will stay at the very left.
How can this be done? I would need to do it programmatically so if the answer is for a pro grammatical solution its better. If it is in IB then I am ok anyway and will find the programmatical version myself.
IB-Version would be to set the 'Position' to be centred.
Change it to be the value in the screenshot.
I'm currently looking for a non-IB-Solution but the docs don't say anything ...
The non IB answer is to set the image position.
i.e. swift would be "btnCheck.imagePosition = .ImageOnly"
and ObjC would be [btnCell setImagePosition:NSImageOnly]

Label/Text inside NSProgressIndicator?

It seems that everybody that needs some text for a NSProgressIndicator (i.e. showing the percentage of a download) ends up putting the text above the widget, or next to it.
Cannot you really show any text inside the NSProgressIndicator widget?
An example of what I mean:
In IB, just embed your progress indicator in a custom view, add a label to that view, and center both the progress indicator and the label within the custom view.
You can put a label where ever you want. The progress indicator doesn't have a text property. So yes, you could put a label onto a progress indicator. If that would look good is an other question.

Question about these UIButtons

How can I get a UIButton like the ones at the bottom of this picutre (move and delete)? Specifically, I want an image with a text just like that. http://4.bp.blogspot.com/_QLwms0mVa4w/SQN0MqPIpXI/AAAAAAAAAA8/lEikKn9eP_0/s1600-h/Screenshot+2008-10-25+15:31:21+-0400-1.png
Thanks.
For Jason:
The image sticks right beside the label. Is there anyway from IB I can set it to align to the left, while the label aligns to the right? Here's what it looks like right now:
What you can do is in Interface Builder, the UIButton can be set to a type of "Custom"
After you have done this, you can simply use your own image for the button and different images for each state of the button.
Although with this approach you won't be able to have additional text modified on it like the mail app has with "Delete (1)". However, if you don't need that then this solution will work for you.
Alternatively, if you just want an image stuck onto your existing button then there is an Image property in Interface Builder where you can slap on an image to your button.
If you need more functionality then you would probably have to create your own UIButton by subclassing to handle it.