fix: 标题栏恢复 LinearLayout,返回按钮100dp宽+左padding
FrameLayout 覆盖层方案导致页面内容消失 改回 LinearLayout,按钮宽度 100dp 图标靠左(paddingStart=21dp) 右侧空白区域都是可点击范围 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,36 +10,34 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<!-- ===== 固定标题栏(不随内容滚动) ===== -->
|
<!-- ===== 固定标题栏(不随内容滚动) ===== -->
|
||||||
<FrameLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
|
android:paddingEnd="21dp"
|
||||||
android:paddingBottom="4dp">
|
android:paddingBottom="4dp">
|
||||||
|
|
||||||
<!-- 标题栏内容 -->
|
<!-- 返回按钮:图标靠左,右侧 padding 扩大点击区域 -->
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/btnBack"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="start|center_vertical"
|
||||||
|
android:paddingStart="21dp"
|
||||||
|
android:text="\ue6bd"
|
||||||
|
android:fontFamily="@font/iconfont"
|
||||||
|
android:textColor="@color/text_primary"
|
||||||
|
android:textSize="28sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTitle"
|
||||||
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:layout_weight="1"
|
||||||
android:paddingEnd="21dp">
|
android:gravity="center"
|
||||||
|
android:textColor="@color/text_secondary"
|
||||||
<TextView
|
android:textSize="20sp" />
|
||||||
android:layout_width="64dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="\ue6bd"
|
|
||||||
android:fontFamily="@font/iconfont"
|
|
||||||
android:textColor="@color/text_primary"
|
|
||||||
android:textSize="28sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvTitle"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="@color/text_secondary"
|
|
||||||
android:textSize="20sp" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvPageNum"
|
android:id="@+id/tvPageNum"
|
||||||
@@ -51,16 +49,7 @@
|
|||||||
android:minWidth="37dp"
|
android:minWidth="37dp"
|
||||||
android:gravity="end" />
|
android:gravity="end" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 透明覆盖层:左半边都是返回点击区域 -->
|
|
||||||
<View
|
|
||||||
android:id="@+id/btnBack"
|
|
||||||
android:layout_width="120dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_gravity="start" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<!-- ===== 可滚动内容区(标题和按钮之间) ===== -->
|
<!-- ===== 可滚动内容区(标题和按钮之间) ===== -->
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
|||||||
Reference in New Issue
Block a user