IOS 'Buttons' with borders - no declares

I know that buttons are supposed to look like labels.

When I have a row of stuff , some of which are buttons, and some are segmented controls, it just looks plain ugly having buttons looking like labels when everything else is neatly outlined. I know there has been some declares code issued that sets the background image, but I dont trust that to stay ‘theme savvy’

So if anyone else feels the same, my solution is:

Create a segmented control with as many segments as you want buttons.

In the ValueChanged event, act on the tap, but then deselect the segment.
What you get is a visual cue that the tap has occurred, and what amounts to an action event

Here is my code for a 2-button ‘toolbar’ style segment:

[code]if me.value = 0 then
//do button 0 things
end if

if me.value = 1 then
//do button 1 things

end if
//reset so that none of the ‘buttons’ looks selected
me.item(0).selected = false
me.item(1).selected = false[/code]

Not meaning to say there is something wrong with your approach; just a sidenote:
If you look for a declare that just changes the UIButton’s buttonType property, this will be theme safe: There is still a roundrect type (which will use the OS’ color theme of course).

I quite expected that there should be.
Searched this forum and the web for an hour or two but failed to find ‘the’ answer, (which I guess is going to rely on a declare since Xojo doesnt expose this style. )
I want to avoid adding declares as much as possible, at the moment.

So I won’t post it :wink:


Do anyway, the title of the post will bring others who want the same thing.

Oh well, I won’t. It’s been quite some time since I worked with iOS and I had forgotten buttonType is a read-only property. You can only change it during a button’s constructor, which means you have to create a custom iOSControl completely by declares …