I think the problem is the opposite. I want the gradient to be scaled to the new density, and it's not happening.
On Dec 1, 1:30 am, NoraBora <[email protected]> wrote: > change android:innerRadius to 150px. > > when you use dp, android will automatically resize from 160dpi to > target dpi. > > On Nov 30, 7:12 am, mgpc <[email protected]> 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/Grad... > > > 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

