checkbox at the center of a NScheckboxcell - objective-c

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]

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 add text under the button previously placed as leftCalloutAccessoryView of MKPinAnnotationView

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.

How to skin the UITableViewCell image used when selecting multiple rows?

When you put the cell in edit mode and allow multiple cells to be selected at once, the UITableView shows a checkbox on the left of the cell, like below.
How do I change that image? Changing the cell.editingAccessoryView just adds another accessory to the right, instead of changing the left one.
Apologies for reading the question wrong at first. Best I can find at the moment is the multiSelectCheckmarkColor property on the tableview. This technically isn't what you are asking for... however, if simply changing the color is a sufficient solution for you then you might be interested this option.
The only working solution I know is not using the default editing mode at all.
You can easily add a custom checkbox to your cell and animate the cell to show it when entering editation mode.

Add UIButton to UITextView Dynamically with UserInteractionEnabled

I am building an app where I need to add buttons to a UITextView dynamically on the basis of text entered by the user in the same UITextView.
The look I want to give is something like To field in message app of iPhone
I am unsable to figure out the way to do the needful.
Any help would be highly appreciated.
Thanks in advance!!
I found out the solution to my problem and no one has yet answered here so will reply to my own question.
I tried to keep a UITextView on a UIScrollView and then kept changing the width of the UItectView and added button to the left of it depending on the text added in the the textView. This will help in giving an appearance similar to that of a textfield with dynamic addition of UIButton.
Hope this wolrs for all those having the similar problem.

Interface Builder won't allow drag/drop of text control to window

Noob dumb question, no doubt -- but here it is:
Trying to tutorialize myself with the Apple "Currency Converter" tutorial for Cocoa ( http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjCTutorial/05View/05View.html)
Embarrassingly, I'm stuck very early on where the instructions ask me to drag-and-drop a text field onto the Currency Converter window. When attempting to do so, I release the mouse and the text field runs animatedly back to the library palette, refusing to "stick" on the client area of the Window.
Clearly the window is readonly or lacks some state or prerequisite to accept the text field, but what?
Are you sure you're dragging a view object and not a cell? Double check that you're dragging NSTextField and not NSTextCell.
Be sure you're not grabbing a text CELL.
When you select the text field from the Library, check that the description is NSTextField
Have you added a view to the window? Because if there is no view then you won't be able to add any controls.
Drag a "View" object over to your window.