我的问题是我想在LinearLayout中重叠两个TextView。在智能手机上看起来没问题,但在平板电脑上负边距让我很难处理。
这是我想要实现的布局
以下是代码。我该如何修改它以便让一个TextView重叠在另一个TextView的右上方而不使用负边距?
这是我想要实现的布局
![enter image description here](https://istack.dev59.com/4Apzo.webp)
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@drawable/bottom_bar_back_with_arrow"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center">
<TextView
android:id="@+id/mShowHideScale"
style="@style/BottomBarButton"
android:layout_weight="1"
android:drawableTop="@drawable/show_calibrate_tool"
android:text="Calibrate" />
<TextView
android:id="@+id/badgeRadius"
android:layout_width="14dip"
android:layout_height="14dip"
android:textColor="@color/primary_color"
android:textStyle="bold"
android:gravity="center"
android:background="@drawable/shape_notification"
android:layout_marginLeft="-18dp"
android:layout_marginTop="-27dp"/>
</LinearLayout>
</FrameLayout>