Not sure to understand the nine patch was just a PNG constructed with
the tools. I didn't use any XML file to define properties on the nine
patch. Though the nine patch as background worked fine as long as it
wasn't changed in the code.

I read somewhere about padding that isn't recalculated. But I still
don't see how it could affect a background. In my mind a background
just fill all the space except margins.

If we change a background it shouldn't affect any dimension. And
backgrounds shouldn't have any effect on dimensions.

I'll fill a bug about that.

On 6 nov, 08:39, Kumar Bibek <[email protected]> wrote:
> It also depends how your 9-patch is behaving. Make sure, you don't have any
> paddings in the 9-patch drawable.
>
> 2010/11/6 лойк <[email protected]>
>
>
>
>
>
> > After messing around, I finally got it work as expected. I felt I had
> > to share that with people.
>
> >    <LinearLayout android:id="@+id/avatar_layout"
> >                  android:drawingCacheQuality="auto"
> >                  android:layout_width="70dip"
> >                  android:layout_height="70dip"
> >                  android:layout_gravity="top">
> >        <ImageView android:id="@+id/img_avatar"
> >                   android:src="@drawable/question"
> >                   android:layout_width="fill_parent"
> >                   android:layout_height="fill_parent"
> >                   android:scaleType="centerCrop">
> >        </ImageView>
> >    </LinearLayout>
>
> > Ok this layout can be added in any layout and it should just work.
> > img_avatar can be anything.
>
> > After I manually change the background on the layout programmatically,
> > I have to do that : avatar_layout.setPadding(7, 7, 7, 7); on the
> > layout that wrap my ImageView. The padding can be whatever you want in
> > pixels. Apparently after the background is changed. The padding get
> > messed up. So manually editting the padding in the code actually fix
> > sizing problems. I don't if it's a bug or normal behavior. I believe
> > the right behavior should use the layout params unless changed by the
> > user. Changing the background shouldn't affect the layout. That's just
> > weird.
>
> > --
> > 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]<android-developers%2Bunsubs 
> > [email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com

-- 
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