我正在学习Android中的坐标系。了解Android中的矩形
我想知道为什么在右侧的X坐标值中出现负号。
矩形的总宽度应为100px。(请参阅图像ID'图像')。
矩形的结果是:
Rect(20, 95 - 120, 195)
我XML布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_marginLeft="10px"
android:layout_marginTop="10px"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_marginLeft="10px"
android:layout_marginTop="10px"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:src="@drawable/ic_launcher"
android:layout_width="100px"
android:layout_height="100px"
/>
</LinearLayout>
<ImageView
android:id="@+id/image2"
android:src="@drawable/ic_launcher"
android:layout_width="100px"
android:layout_height="100px"
/>
</LinearLayout>
显示一些代码,你如何得到这个'Rect'值? – Bryan