“&GT; &LT;按钮 机器人:layout_width = “match_parent” 机器人:layout_height = “match_parent” 机器人:文字=” 货币 </跨度> ……“ 机器人:ID =“@ + ID / 货币 </跨度> “ 机器人:TEXTSIZE = “12SP” 安卓的onClick = “点击” android:gravity =“center …
我认为工具栏与您的内容布局重叠。只需添加 app:layout_behavior="@string/appbar_scrolling_view_behavior" 到了根 RelativeLayout ,不要使用填充。
app:layout_behavior="@string/appbar_scrolling_view_behavior"
RelativeLayout
添加填充到内容的顶部等于的高度 actionBar 抵消它:
actionBar
<RelativeLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingTop="?attr/actionBarSize" xmlns:android="http://schemas.android.com/apk/res/android"> ...
也替换所有 fill_parent 同 match_parent 因为它已被弃用并且都做同样的事情。
fill_parent
match_parent