Button stylings for mobile

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Button stylings for mobile

Post by teacherguy » Sat Oct 03, 2015 1:22 pm

Has anyone come up with some style settings that result in decent looking buttons without have to use icons? I'm working on an app where I want the button names to show, so I'd like to avoid using icons.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Button stylings for mobile

Post by jmburnod » Sat Oct 03, 2015 9:13 pm

Hi,
I think icon way for btns is the best way.
If you want display btn's name why not making an icon with text ?
You can do this and create effects useful for hilite and avoïd eventuals fonts problemes.
Best regards
Jean-Marc
https://alternatic.ch

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Button stylings for mobile

Post by teacherguy » Sun Oct 04, 2015 1:21 am

Yes, I agree with you. However in this case I am generating the buttons via script.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Button stylings for mobile

Post by jmburnod » Sun Oct 04, 2015 1:53 am

I am generating the buttons via script.
Yes, you can do a mercery. I use two groups one for icon one for hiliteIcon
Best regards
Jean-Marc
https://alternatic.ch

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Button stylings for mobile

Post by teacherguy » Sun Oct 04, 2015 5:43 pm

I want the button name to be on the button itself, not below. Unless I'm mistaken, once I use an icon this is not possible.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Button stylings for mobile

Post by jmburnod » Sun Oct 04, 2015 6:09 pm

I want the button name to be on the button itself, not below. Unless I'm mistaken, once I use an icon this is not possible.
Yes. You have to set the showname of btn bMyBtnName to false

You can put the title in the icon
To do I build a group with a grc and a fld


Pseudocode
Place you field with the btn title to the loc of your grc
Select both
Groups
set the name of this group to grMyBtnName
Import snapshot from group grMyBtnName
set the name of last img to iMyBtnName
new btn
set the name of last btn to bMyBtnName
set the icon of btn bMyBtnName to the short id of img iMyBtnName
set the showname of btn bMyBtnName to false

And the same for hiliteIcon

Jean-Marc
https://alternatic.ch

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7397
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Button stylings for mobile

Post by jacque » Sun Oct 04, 2015 6:38 pm

Check the iconGravity property in the dictionary, it may do what you need.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Button stylings for mobile

Post by teacherguy » Fri Oct 16, 2015 11:13 pm

Thanks Jacque, that was it.

Post Reply