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>