我在整个屏幕上有一个图像视图,右下角有一个按钮。
现在,我没有成功在按钮下方和右侧放置基准线。
我希望按钮从右侧“边缘”为 4.1%,从底部“边缘”为 4.1%,使用指南。
这是我的尝试。
如何解决?
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/imageView" />
<Button
android:layout_width="wrap_content"
android:layout_height="30dp"
android:id="@+id/button_try"
app:layout_constraintRight_toLeftOf="@+id/guideline_for_try_from_bottom"
app:layout_constraintBottom_toTopOf="@+id/guideline_for_try_from_bottom"/>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_for_try_from_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintWidth_max="26dp"
app:layout_constraintWidth_min="15dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintGuide_percent="0.041" />
</androidx.constraintlayout.widget.ConstraintLayout>
它看起来像:
|
button 4.1% | END_OF_SCREEN
4.1% |
____________
BOTTOM_OF_SCREEN