I'm having trouble understanding the gradientRadius attribute also, it 
would seem based on the documentation that a value of 50.0% would result in 
an evenly balanced radius but any % value I enter (from 0.1% to 99.9%) 
results in the android:endColor being the only visible color. Does anyone 
have any idea how the % values are supposed to work?

On Sunday, November 29, 2009 5:12:34 PM UTC-5, mgpc wrote:
>
> Hi, 
>
> I'm trying to work with the (wonderfully undocumented) android 
> gradient drawables in a way that's independent of screen density. No 
> luck so far. 
>
> This is the gradient drawable that I'm using: 
>
>   <gradient android:type="radial" 
>       android:startColor="#FFFFFFFF" 
>       android:centerColor="#FFFFFF" 
>       android:endColor="#FF0000" 
>       android:innerRadius="150dp" 
>       android:gradientRadius="350" 
>    /> 
>
> It looks fine on a standard HTC Dream screen, but the scaling is wrong 
> on the higher-density Droid screen. (I tried it both on the emulator 
> and the hardware) 
>
> If I try to change it to 
>
>       android:gradientRadius="350dp" 
>
> I get the following error: 
>
> Dimension types not allowed (at 'gradientRadius'  with value '350dp'). 
>
> The relevant documentation, is, ahem, a little light on detail: 
>
> http://developer.android.com/reference/android/graphics/drawable/GradientDrawable.html#attr_android:gradientRadius
>  
>
> Any idea what's going on here. Why can units not be specified for 
> gradientRadius? Is there a way to specify a denisty-independent 
> gradientRadius from the XML file? Or have I misunderstood what 
> gradientRadius is doing? 
>
> Any help appreciated. 
> Thanks, 
> Mark 
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to