切断“片段"页面底部的项目 [英] Cut off items at the bottom of the Fragment page

查看:108
本文介绍了切断“片段"页面底部的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的项目放在页面底部并且其中一半被裁剪时,我有一个片段"页面

I have a Fragment page when my items are placed at the bottom of the page and half of them are cropped

此代码片段

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!--<android.support.v7.widget.RecyclerView-->
        <!--android:id="@+id/Recycler"-->
        <!--android:layout_width="match_parent"-->
        <!--android:layout_height="match_parent"-->
        <!--android:layout_marginRight="10dp"-->
        <!--android:layout_marginLeft="10dp"/>-->

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Save"
        android:textColor="@color/colorWhite"
        android:background="@color/colorBlue"
        android:textSize="20dp"
        android:layout_alignParentBottom="true"/>

</RelativeLayout>

此代码活动

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorWhite">

    <FrameLayout
        android:id="@+id/Fragment_Main"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </FrameLayout>

    <android.support.v7.widget.Toolbar
        android:id="@+id/main_toolBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorCenteral"
        android:layoutDirection="rtl"
        android:minHeight="?attr/actionBarSize"
        android:theme="@style/ToolBarStyle" />

</RelativeLayout>

推荐答案

请将此代码添加到 res> values> styles.xml

<resources>
    <style name="AppTheme.NoActionBar">
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>

并编辑 AndroidManifest.xml

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme.NoActionBar">

您必须使用 @ style/AppTheme.NoActionBar

这篇关于切断“片段"页面底部的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆