如果我有一个包含 ImageViews 的 LinearLayout,我如何编写代码来判断哪个(如果有)被屏幕边缘裁剪?
<LinearLayout android:id="@+id/imagecontainer"
android:orientation="horizontal"
android:layoutHeight="wrap_content"
android:layoutWidth="fill_parent">
<ImageView android:id="@+id/image1" .../>
<ImageView android:id="@+id/image2" .../>
...
<ImageView android:id="@+id/imageN" .../>
</LinearLayout>
我想像这样的东西,如果没有人被剪裁,它将返回一个索引或 0。函数调用的语义并不重要......我只需要一些方法来判断是否有剪辑,如果有,是谁?
int whichImageIsClipped(LinearLayout root) { ... }