我的项目我使用工具栏,但是工具栏盲区
如何解决此问题sry此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息此代码详细信息
并在此处输入图片描述。您可以排除边距吗?
此代码我该如何更改?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginStart="0dp"
android:elevation="2dp"
android:minHeight="?attr/actionBarSize"
android:background="@drawable/ic_bar_start">
</Toolbar>
<fragment
android:id="@+id/map_viewer_start"
class="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
tools:context=".fragment.StartFragment" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:gravity="center"
android:layout_alignParentBottom="true"
android:layout_marginBottom="30dp">
<Button
android:id="@+id/mainStartRunning"
android:layout_width="100dp"
android:layout_height="40dp"
android:text="RUNNING"
style="@style/buttonTextRedText"
android:background="@drawable/button_empty_background"
android:onClick="onClick"
android:layout_margin="10dp"
android:gravity="center"/>
<Button
android:id="@+id/mainStartRacing"
android:layout_width="100dp"
android:layout_height="40dp"
android:text="RACING"
style="@style/buttonText"
android:background="@drawable/button_background"
android:onClick="onClick"
android:layout_margin="10dp"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
无论是使用layout_below
的属性RelativeLayout
如下图所示
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Toolbar
android:id="@+id/toolbar"
android:layout_alignParentTop="true"
...>
</Toolbar>
<LinearLayout
android:layout_below="@+id/toolbar"
android:layout_above="@+id/bottom_layout"
...>
</LinearLayout>
<LinearLayout
android:id="@+id/bottom_layout"
android:layout_alignParentBottom="true"
...>
</LinearLayout>
</RelativeLayout>
或LinearLayout
与orientation
垂直一起使用
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Toolbar
...>
</Toolbar>
<LinearLayout
...>
</LinearLayout>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句