
AndroidのレイアウトでViewを一部重ねた状態で表示させたいです。
想定しているのは画像のように青いViewの下が5pxはみ出している状態で赤いViewに半分横幅が重なっている状態です。
半分横幅が重なっている状態は作ることができたのですが、5pxはみ出すことができずに困っています。
参考になるサイトなどご存知でしたら教えていただきたいです。
よろしくお願いします。
重ねたいviewの現状の制約は下記のように設定しています。2つ目のものを重ねて設定したいと考えています。
<ImageView android:layout_width="@dimen/update_battery_icon_width" android:layout_height="@dimen/update_battery_icon_height" app:srcCompat="@drawable/ic_battery_3" android:visibility="visible" android:id="@+id/update_battery" app:layout_constraintTop_toBottomOf="@+id/firmware_name" app:layout_constraintStart_toEndOf="@+id/firmware_version" app:layout_constraintEnd_toStartOf="@+id/firmware_battery_value" android:layout_marginTop="11dp" android:layout_marginEnd="4dp"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" app:srcCompat="@drawable/ic_alert_small" android:id="@+id/general_error" app:layout_constraintStart_toEndOf="@+id/imageView" android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="@+id/imageView" app:layout_constraintTop_toBottomOf="@+id/firmware_version" app:layout_constraintBottom_toBottomOf="@+id/imageView"/>
回答1件
あなたの回答
tips
プレビュー