我试图在屏幕底部放置3个按钮,当设置约束失败时,这是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.gms.maps.MapView
android:layout_width="match_parent"
android:layout_height="100dp"
android:id="@+id/mapa"/>
<ImageButton
android:id="@+id/imageButton7"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginBottom="60dp"
android:layout_marginStart="60dp"
android:background="@drawable/custom_center_map"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/ic_user_blanco" />
<ImageButton
android:id="@+id/imageButton8"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginBottom="60dp"
android:layout_marginEnd="60dp"
android:background="@drawable/custom_center_map"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_user_blanco" />
<Button
android:id="@+id/button3"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginBottom="60dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:background="@drawable/custom_center_map"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/imageButton8"
app:layout_constraintStart_toEndOf="@+id/imageButton7" />
</android.support.constraint.ConstraintLayout>
每个按钮都有60(底部约束值),但该值未在设备中显示。
该代码是一个片段,因为它位于选项卡中,这是怎么回事? 我该怎么解决?
img 1在平板电脑中 img2位于连结S