Question

I'm building a Container using code and now I want to set the Styleusing one UnselectedStyle from the Resource Editor.

I'm doing this because, I don't find the way to add a LinearBackground color and a RoundBorder to my Container. When I put the two properties to the Style, the background color has gone.

So I finally add this Style using the UIManager.getInstance().addThemeProps(String name ThemeFromResource); and later the setUIID(String nameStyle). Is working fine...my Containergets the Style, but the app lose the navigation, the back Commandhas gone.

How can do this? I would like to do with my first way...creating the lineargradient and the border and adding it to the style, but I don't find the way.

Was it helpful?

Solution

I would strongly suggest against doing that.

Border's override other forms of background, round border tries to respect some of them but is REALLY inefficient about that. It effectively draws the background on a mutable image then draws the round border on another mutable image, gets the RGB for both and performs a NOT operation to crop the background into a round image. This (as you might understand) is REALLY expensive in terms of performance, while the image is then cached it is still expensive in the longer term.

You should use image borders which are MUCH faster.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top