Analysis of Android:clipchildren Properties--whether to trim sub view

Source: Internet
Author: User

Mainactivity as follows:
Package Cc.testclipchildren;import android.os.bundle;import android.app.activity;/** * Android:clipchildren Attribute Analysis * The default value of this property is Android:clipchildren= "true" * the literal meaning of the clipchildren means: Cut (shorten) the child * We set its value to false then when the child control is taller than the parent control, the * will also be fully displayed. And will not be compressed. * For example in this example: * The parent linear layout height is specified as 50dip * But the height of the second imageview is set to 70dip. * But the picture is still intact and does not show only part of it * Here you can set android:clipchildren= "true" observation effect *  NOTE: * Set this property at the root node of the layout Android:clipchildren *< c1/>* Reference: * 1 http://www.cnblogs.com/over140/p/3508335.html * 2 http://www.chengxuyuans.com/Android/66745.html *   Thank you very much * */public class Mainactivity extends Activity {@Overrideprotected void onCreate (Bundle savedinst Ancestate) {super.oncreate (savedinstancestate); Setcontentview (R.layout.main);}}


The

Main.xml is as follows:

<?xml version= "1.0" encoding= "Utf-8"? ><relativelayout xmlns:android= "http://schemas.android.com/apk/res/    Android "Android:layout_width=" Match_parent "android:layout_height=" Match_parent "android:clipchildren=" false " > <linearlayout android:layout_width= "match_parent" android:layout_height= "50dip" Androi D:layout_centerinparent= "true" android:orientation= "horizontal" > <imageview android:layout _width= "0dip" android:layout_height= "fill_parent" android:layout_weight= "1.0" Android:sca Letype= "Fitcenter" android:src= "@drawable/ic_launcher"/> <imageview android:layout_wid Th= "0dip" android:layout_height= "70dip" android:layout_gravity= "Bottom" android:layout_we Ight= "1.0" android:scaletype= "Fitcenter" android:src= "@drawable/ic_launcher"/> <imagev Iew Android:layout_widTh= "0dip" android:layout_height= "fill_parent" android:layout_weight= "1.0" android:scalety Pe= "Fitcenter" android:src= "@drawable/ic_launcher"/> </LinearLayout></RelativeLayout>



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.