我在Android中看到了关于锚点视图的参考。如果可能,请提供一个带解释的示例。我认为它与某些视图组相关。
我在Android中看到了关于锚点视图的参考。如果可能,请提供一个带解释的示例。我认为它与某些视图组相关。
<ImageView
android:id="@+id/value_animator_subjectb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="?android:attr/textSelectHandle"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="190dp"
android:layout_alignLeft="@+id/xyz_button" />
ImageView将会与id为xyz_button的视图左对齐,因此在这种情况下,id为xyz_button的视图是锚定视图。
android:layout_alignTop
、android:layout_alignBottom
等。在这些属性中,我们提供一个视图的ID来对齐我们的视图。android:layout_alignBottom="@+id/add_btn"
addBtnView
的视图是我们的锚点视图。