Sunday, June 30, 2013

Re: [android-developers] Re: 9.png file not spanning the LinearLayout when android:paddingBottom is specified

That kind of makes sense. However, even if the padding gets overwritten, the Button should still be over the red background since that is the content area of the 9.png. Why would the Button be positioned on the drop shadow (the non-content area of the 9.png)? Seems like there is some undefined non-intuitive behavior happening whereas it would be preferable for either of the defined padding to be applied (as that would the intuitive behavior).


On Sat, Jun 29, 2013 at 11:54 PM, Piren <gpiren@gmail.com> wrote:
Part of what 9patches do is define padding... if you define them on your own you'll overwrite the settings provided by the 9patch.

On Saturday, June 29, 2013 2:10:36 AM UTC+3, Shri wrote:
I have the following layout file which uses the attached 9.png. It results in the attached screenshot where the red background from the 9.png does not extend all the way behind the button. If I remove the android:paddingBottom="1dp" attribute below, things work as I expect. Is this behavior expected (if so, why), or is this a bug?

Thanks,
Shri

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/container"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#0000ff" >
    <LinearLayout
        android:id="@+id/view_with_drop_shadow"
        android:orientation="vertical"
        android:paddingBottom="1dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/red_background_with_drop_shadow" >
    
        <Button
            android:text="Hello"
            android:layout_width="wrap_content"
            android:layout_height="48dip" />
    
    </LinearLayout>
</LinearLayout>

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Android Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-developers/oXTXTevOqEE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate