4
为什么android:clipChildren =“false”不起作用?我想实现与CSS overflow相同的效果:可见,以便即使位于其父级布局之外的子视图也可见。我尝试过这样的事情,虽然Eclipse中的图形布局显示正确的行为,但在手机上它不起作用。Android ViewGroup剪辑不起作用
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#0000FF"
android:clipChildren="false"
android:clipToPadding="false" >
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentLeft="true"
android:background="#FF0000"
android:clipChildren="false"
android:clipToPadding="false" >
<RelativeLayout
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="120dp"
android:background="#00FF00" />
</RelativeLayout>
</RelativeLayout>
这很有趣,但我不能相反让父母把他们的孩子剪短。但我有LinearLayout。也许这是原因? – Gangnus 2012-01-18 16:14:17