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">
|
||||
|
||||
<!-- ===== 固定标题栏(不随内容滚动) ===== -->
|
||||
<FrameLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="21dp"
|
||||
android:paddingBottom="4dp">
|
||||
|
||||
<!-- 标题栏内容 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
<!-- 返回按钮:图标靠左,右侧 padding 扩大点击区域 -->
|
||||
<TextView
|
||||
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:gravity="center_vertical"
|
||||
android:paddingEnd="21dp">
|
||||
|
||||
<TextView
|
||||
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" />
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPageNum"
|
||||
@@ -51,16 +49,7 @@
|
||||
android:minWidth="37dp"
|
||||
android:gravity="end" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 透明覆盖层:左半边都是返回点击区域 -->
|
||||
<View
|
||||
android:id="@+id/btnBack"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start" />
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- ===== 可滚动内容区(标题和按钮之间) ===== -->
|
||||
<FrameLayout
|
||||
|
||||
Reference in New Issue
Block a user