hey

is there a way to use isIphone() to apply one or another style?
something like:
if(!isIphone() || !isIpad()){
style $baseColor = rgb(80, 80, 80)
}

can’t figure it out how to do…

greetings!

Submitted on 17 May 2011 at 14:25

On 17 May 2011 at 17:18 Zef Hemel commented:

You cannot dynamically change style constants. Style constants are statically (at compile-time) expanded and cannot be modified at run-time.

What you can do is use isIphone() to choose a style:

screen root() {
block(isIphone() ? iPhoneStyle : regularStyle) {
“This block is style with a styled based on the used phone”
}
}

Log in to post comments