The Android child control is outside the parent control's scope display method

Source: Internet
Author: User

<relativelayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
Android:clipchildren= "false" >

<imageview
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
Android:layout_marginbottom= "60DP"
android:background= "@mipmap/www"/>


<linearlayout
Android:id= "@+id/ll_bottom"
Android:layout_width= "Match_parent"
android:layout_height= "60DP"
Android:layout_alignparentbottom= "true"
Android:background= "#F8549D"
android:elevation= "10DP"
android:orientation= "Horizontal" >

<relativelayout
Android:layout_width= "0DP"
android:layout_height= "Match_parent"
android:layout_gravity= "Bottom"
android:layout_weight= "1" >

<imageview
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_centerinparent= "true"
android:src= "@mipmap/ic_launcher"/>

</RelativeLayout>

<relativelayout
Android:layout_width= "0DP"
android:layout_height= "Match_parent"
android:layout_gravity= "Bottom"
android:layout_weight= "1" >

<imageview
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_centerinparent= "true"
android:src= "@mipmap/ic_launcher"/>

</RelativeLayout>

<relativelayout
Android:layout_width= "70DP"
android:layout_height= "70DP"
android:layout_gravity= "Bottom"
android:background= "@drawable/bottom_bg_shape" >

<imageview
Android:layout_width= "30DP"
android:layout_height= "30DP"
Android:layout_centerinparent= "true"
android:src= "@mipmap/icon_go"/>

</RelativeLayout>


<relativelayout
Android:layout_width= "0DP"
android:layout_height= "Match_parent"
android:layout_gravity= "Bottom"
android:layout_weight= "1" >

<imageview
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_centerinparent= "true"
android:src= "@mipmap/ic_launcher"/>

</RelativeLayout>

<relativelayout
Android:layout_width= "0DP"
android:layout_height= "Match_parent"
android:layout_gravity= "Bottom"
android:layout_weight= "1" >

<imageview
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_centerinparent= "true"
android:src= "@mipmap/ic_launcher"/>

</RelativeLayout>
</LinearLayout>

</RelativeLayout>

This picture is what I just did, the effect is to refer to the cool dog music player to complete, I would like to explain the focus on the bottom of the navigation bar: as shown

One more counter effect preview:

How to make the blue round play key appear over the pink range. Of course, after a reasonable layout can achieve this effect, but there are simpler ways. That is, add a property from Android itself to the properties of the root layout:


Android:clipchildren= "false"

Attribute explanation and Description:

1, Android:clipchildren meaning: whether to restrict the child view within its scope

2, can through android:layout_gravity control over how the part of the display.

3, only in the root node set Android:clipchildren to False, the default is True

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.