本文仅记录项目所遇问题
原因:布局问题
1、原布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_menu"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_f7"
android:padding="12dp">
<RelativeLayout
android:id="@+id/rl_left"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/tv_choose"
android:background="@color/gray_f7">
<TextView
android:id="@+id/tv_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginRight="50dp"
android:layout_weight="1"
android:background="@mipmap/ic_go_left" />
</RelativeLayout>
<TextView
android:id="@+id/tv_choose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="2018-06"
android:textColor="@color/black_33"
android:textSize="16sp" />
<RelativeLayout
android:id="@+id/rl_right"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/tv_choose"
android:background="@color/gray_f7">
<TextView
android:id="@+id/tv_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="50dp"
android:layout_weight="1"
android:background="@mipmap/ic_go_right_1" />
</RelativeLayout>
</RelativeLayout>
<GridView
android:id="@+id/gridView_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numColumns="4"
android:paddingHorizontal="5dp"
android:paddingVertical="15dp" />
</LinearLayout>
2、修改后布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_f7"
android:padding="12dp">
<RelativeLayout
android:id="@+id/rl_left"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/tv_choose"
android:background="@color/gray_f7">
<TextView
android:id="@+id/tv_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginRight="50dp"
android:layout_weight="1"
android:background="@mipmap/ic_go_left" />
</RelativeLayout>
<TextView
android:id="@+id/tv_choose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="2018-06"
android:textColor="@color/black_33"
android:textSize="16sp" />
<RelativeLayout
android:id="@+id/rl_right"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/tv_choose"
android:background="@color/gray_f7">
<TextView
android:id="@+id/tv_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="50dp"
android:layout_weight="1"
android:background="@mipmap/ic_go_right_1" />
</RelativeLayout>
</RelativeLayout>
<GridView
android:id="@+id/gridView_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numColumns="4"
android:background="@color/white"
android:paddingHorizontal="5dp"
android:paddingVertical="15dp" />
</LinearLayout>