小编Ork*_*mli的帖子

Android片段底部奇怪的空白区域?

我遇到了一个奇怪的问题:片段底部有一个空白区域,我无法摆脱它.值得一提的是,如果我点击任何按钮,这个空间就会消失.

任何帮助表示赞赏!请在下面找到屏幕截图和布局代码.

截图

DetailActivity布局:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.ogasimli.manat.activity.DetailActivity"
tools:ignore="MergeRootFrame" />
Run Code Online (Sandbox Code Playgroud)

DetailFragment布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.ogasimli.manat.fragment.DetailActivityFragment"
android:background="@color/colorAccent">

<android.support.design.widget.CoordinatorLayout
    android:id="@+id/detail_result_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:visibility="gone"
    tools:visibility="visible">

    <android.support.design.widget.AppBarLayout
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        app:elevation="0dp"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar_detail"
            android:layout_width="match_parent"
            android:layout_height="?actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.AppBarOverlay"/>

    </android.support.design.widget.AppBarLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_marginTop="?actionBarSize"
        android:weightSum="7">

        <include layout="@layout/detail_chart_grid"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="4.5"/>

        <include layout="@layout/detail_extras_grid"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="2.5"/>

    </LinearLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab_share_details"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="24dp"
        android:elevation="8dp"
        android:src="@drawable/ic_share"
        app:layout_anchor="@id/cardview_details"
        app:layout_anchorGravity="top|right|end"
        app:rippleColor="@color/colorPrimary"
        tools:targetApi="lollipop"/>

</android.support.design.widget.CoordinatorLayout>

<LinearLayout
    android:id="@+id/detail_error_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

xml layout android fragment android-fragments

5
推荐指数
1
解决办法
1297
查看次数

标签 统计

android ×1

android-fragments ×1

fragment ×1

layout ×1

xml ×1