IPhone: Custom Button - Why is title not showing? - iphone

So I basically dragged a button from interface builder's library, turned it into a Custom button. Then I added one png for the "default state configuration" and another png for the "highlighted state configuration". Let's just assume these png's are a red box and a blue box.
Now, I'd like the Title to display for the button i.e., "Press Me" or something. But the Title doesn't show. Am I missing something?? (I also tried to have that text in different colors but no dice...)
Thanks in advance.

Are you setting imageForState or backGroundImageForState? :)

Related

How to remove the white box around the NSButton checkbox when disabled?

Update:
I have added a demo on my Github to demonstrate the problem: https://github.com/houmie/CocoaPlayground
Build and start the app, then click on the menu symbol as shown below.
There is not much code to this. Adding a NSButton with Style Check and Type Switch into IB.
In IB it looks fine. But starting the app there is a white box appearing around the disabled checkbox. The background is obviously grey hence it shows.
Is there a way to remove/override that?

Make Button NOT change title color when pressed

I can't find any other question on how to prevent this, and nothing I've tried is working perfectly.
I want to make it so the title color of the text on my button is ALWAYS white (I will do some other styling to make this look good still).
But, every time I press on the button, the title color changes from white to grey. How can I stop this? Preferably in the storyboard file instead of programmatically.
Images for illustration:
Not pressed:
Pressed:
Select -> Type: Custom in Attributes ispector

Repeatbox row label not visible until clicked

I am using this youtube link as a guide
When my repeatbox loads, I see three empty row. When I click on the row, the text of the label becomes visible. When I click on a different row, then only the new label is visible.
Has anyone encountered this before? Is there a recommended font size or row height I should be using?
Can you try the following chances,
1. Changing background/font color of the label?
2. Un-check "Enable pull-down to Refresh" & "Enable pull-up to Refresh" options in "Palette". - This is to make confirm that having an issue in repeaterbox rendering rows.
Select "Inactive Item" from "RepeaterBox Edit Mode" from Pallete window. Then add your controls like label, etc.,
You might be added the controls in Active mode. That is why, controls are not visible till you selected.
For more info: http://www.smartface.io/developer/guides/controls/repeatbox/

Interface Builder - Custom Button with Title text

When I set up a custom button in Interface Builder it hides the Title text.
Do you have to create the text for the button too or is it possible to change the Z order so that the Title appears on top?
You are probably setting the 'Image' property of your button instead of the 'Background' property.
'Image' appears over your text, so either programmatically or in NIB(way simpler), set the 'Background' image to your desired png, and set the text for the desired button 'State Config'(default, selected etc), Leaving the 'Image' property blank.
The title by default appears on the top and in no case the text goes behind the button...
Still follow the below steps
1. Drag uibutton to the view
2. Select UIButton
3. Click on the first tab of the Inspector
4. Then Enter the title over there.
The title entered will be on the button..
Hope this helps
For a custom button, I fixed the same problem by going in interface builder and in the tab where you can set up hte title, image, background, etc., if you look lower, there will be a section titled "Control". In that section you can change the alignment and there are also some checkboxes for "Content". Put a checkmark in "Enabled" and "Selected" and it should work. Ensure to have populated the title for the various states of the button.
It may be related to the State Config attribute. I had the same problem and solved it by doing this:
Select your button
In the utilities pane (right pane), select the Attribute inspector (4th tab).
Change the State Config (2nd attribute) to the value "Default".
Enter a Title and press Enter (I tried changing it directly on the button but it is resized automatically).
You may switch back to your previous State Config if it is what you need.

How to display the button transperent in iphone

I am new to iphone development.I have text on the button.I want only test to be displayed and not the button border or color .It should be transparent such that only there is text in view and not the button.It is possible to do that in interface builder?Please help me out. Thanks.
Select "Custom" as the button's type in the inspector. However, I would recommend against such design unless it's really necessary because if a button doesn't look like a button it may be confusing to your users.