How to make an Android child control go beyond the parent control's range display _android

Source: Internet
Author: User

First look at a preview:

Nonsense not much to say, directly on the code:

<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= "60 DP "android:layout_alignparentbottom=" "true" android:background= "#F8549D" android:elevation= "10DP" Android:orientat ion= "Horizontal" > <relativelayout android:layout_width= "0dp" android:layout_height= "Match_parent" Andro
    id: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> &LT
   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&gt
 
 
  ; <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=" W
 Rap_content "   Android:layout_centerinparent= "true" android:src= "@mipmap/ic_launcher"/> </RelativeLayout> <re Lativelayout android:layout_width= "0DP" android:layout_height= "match_parent" android:layout_gravity= "Bottom" a ndroid:layout_weight= "1" > <imageview android:layout_width= "wrap_content" android:layout_height= "Wrap_co" Ntent "android:layout_centerinparent=" true "android:src=" @mipmap/ic_launcher "/> </RelativeLayout> & Lt;/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

Summarize

The above is how to make Android (Android) child control beyond the scope of the parent control to display all the content, have you learned? I hope this article can help you.

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.