Unable to set height of NSButton - objective-c

I have some NSButtons of style Round Textured inserted into an NSToolbar.
I have created some custom images for the buttons and would like to make them vertically bigger, however the height field for the button is greyed out.
Anyone got any ideas why, and if there is a way around it?
Thanks
Gareth

From NSButtonCell Class Reference
NSTexturedRoundedBezelStyle The height of this button is fixed.
You can use NSTexturedSquareBezelStyle Bezel Styles

You have to uncheck Bordered in the latest version of XCode

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.

NSWindow color not changing if I am using it as NSSheet. How resolve this issue?

I know it seems to be a trivial question however I am facing hard time to find a solution.
Please let me explain what I am doing.
How I am changing NSWindow background Color
I have generated a User defined runtime attributes Key backgroundColor of type Color for the NSWindow
Issue
The above way is working fine however when I am calling the NSWindow as NSSheet then the color of window is not changing.
Please suggest some solution for the issue. Many thanks.
This is happening because when an NSWindow is a sheet, It doesn't draw It's background color.
I think a solution to this would be to add a background view to your window and draw the background using this view instead of using the window's backgroundColor property.
Like this sample app.

Nothing happens if press on transparent part of uicollectionviewcell in iOS8 Today Extension

I have widget with collection of icons and these icons are on transparent background. UICollectionViewCell is also transparent. The problem is that if press on transparent part of the cell -
(void)collectionView:didSelectItemAtIndexPath:
is not called.
But if change cell's backgroundView to black color with alpha = 0.01 everything works well. I have a feeling that alpha solution is not the best one. Am I doing something wrong or anybody have better solution?
You NEED the 0.01 alpha workaround.
According to Apple's DTS, it is an iOS 8 bug.
The solution for the moment is to create a empty text label as a background view, or add it in the .xib file as a first view.

weird gap when using uiscrollview and uilabel

here is the problem i have a tow muti-line label with many content, so I use a scroll view to show them all
then I follow this to do the autolayout: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/AutoLayoutbyExample/AutoLayoutbyExample.html#//apple_ref/doc/uid/TP40010853-CH5-SW2
basic idea is to make a container view outside the scroll view to make sure the labels can fill the scroll view no matter what direction it is.
here is the hierarchy and constraint:
and the portrait mode works well:
but when it change to landscape mode some wired gap pops up!
and the more text i put in the label the higher gap i got!
my question is what should i do to kill those gap?
please give me some explicit solution or just give me an example, thank you!
and i am using autolayout in ios7, so some solution without coding are preferred!

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]