切断“片段”页面底部的项目

时间:2019-07-10 14:14:01

标签: android

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

enter image description here

此代码Fragment

<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>

此代码Activity

<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>

1 个答案:

答案 0 :(得分:0)

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

    Class CheckPoint(){    
    var id:String = null
            def this(records: Records){
                 this()
            id = records.id+records.checkpoint
           }
    }

    in other class.
    var records:Datset[Records] = getRecords.as[Records]
    var checkpoint:Dataset[CheckPoint] = records.map(rec=> new CheckPoint(rec))(Encoders.product[CheckPoint])

并编辑 AndroidManifest.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>

您必须使用<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">

相关问题