Alias-CSL 2017-12-02 05:37 采纳率: 0%
浏览 3906

Android将theme设置为noactionbar后,还是有一个actionbar,怎么搞

我将应用theme设置为NoActionBar,设置的页面在as预览于没问题,如图:图片说明
但是在虚拟机运行么就这样了:图片说明
布局代码如下:

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:fitsSystemWindows="true"
    android:theme="@style/AppTheme"
    tools:context=".layout.UserFragment">
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="120dp"
        android:background="@drawable/user_top">
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_margin="20dp"
            android:layout_alignParentLeft="true"
            android:orientation="vertical">
            <TextView
                android:id="@+id/uername"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="@color/white"
                android:textSize="40sp"
                android:text="Mr.Alias"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="查看或编辑个人主页"
                android:textColor="@color/white"
                android:textSize="18sp"/>
        </LinearLayout>
        <de.hdodenhof.circleimageview.CircleImageView
            android:id="@+id/profile_image"
            android:layout_width="96dp"
            android:layout_height="96dp"
            android:layout_margin="20dp"
            android:layout_alignParentRight="true"
            android:src="@drawable/slide_6"
            app:civ_border_width="1dp"
            app:civ_border_color="#000"/>
    </RelativeLayout>

        <RelativeLayout
            android:id="@+id/rl_messageCenter"
            android:background="@drawable/underline"
            android:padding="5dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <ImageView
                android:id="@+id/iv1"
                style="@style/userPartImage"
                android:background="@drawable/ic_message"/>
            <TextView
                android:id="@+id/tv1"
                style="@style/exploreText"
                android:layout_toRightOf="@+id/iv1"
                android:text="消息中心"/>
            <ImageView
                style="@style/exploreArrows"
                android:background="@drawable/ic_arrows"/>
        </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginTop="20dp">
        <RelativeLayout
            android:id="@+id/rl_myAttention"
            android:background="@drawable/underline"
            android:padding="5dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/iv01"
                style="@style/userPartImage"
                android:background="@drawable/ic_attention"/>
            <TextView
                android:id="@+id/tv01"
                style="@style/exploreText"
                android:layout_toRightOf="@+id/iv01"
                android:text="我的关注"/>
            <ImageView
                style="@style/exploreArrows"
                android:background="@drawable/ic_arrows"/>
        </RelativeLayout>
        <RelativeLayout
            android:id="@+id/rl_myCollection"
            android:background="@drawable/underline"
            android:padding="5dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/iv02"
                style="@style/userPartImage"
                android:background="@drawable/ic_collect"/>
            <TextView
                android:id="@+id/tv02"
                style="@style/exploreText"
                android:layout_toRightOf="@+id/iv02"
                android:text="我的收藏"/>
            <ImageView
                style="@style/exploreArrows"
                android:background="@drawable/ic_arrows"/>
        </RelativeLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginTop="20dp">
        <RelativeLayout
            android:id="@+id/rl_expandThesaurus"
            android:background="@drawable/underline"
            android:padding="5dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/iv03"
                style="@style/userPartImage"
                android:background="@drawable/ic_expand"/>
            <TextView
                android:id="@+id/tv03"
                style="@style/exploreText"
                android:layout_toRightOf="@+id/iv03"
                android:text="扩充词库和语音库"/>
            <ImageView
                style="@style/exploreArrows"
                android:background="@drawable/ic_arrows"/>
        </RelativeLayout>
        <RelativeLayout
            android:id="@+id/rl_setting"
            android:background="@drawable/underline"
            android:padding="5dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/iv04"
                style="@style/userPartImage"
                android:background="@drawable/ic_setting"/>
            <TextView
                android:id="@+id/tv04"
                style="@style/exploreText"
                android:layout_toRightOf="@+id/iv04"
                android:text="设置"/>
            <ImageView
                style="@style/exploreArrows"
                android:background="@drawable/ic_arrows"/>
        </RelativeLayout>
        <RelativeLayout
            android:id="@+id/rl_satisfactionSurvey"
            android:background="@drawable/underline"
            android:padding="5dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/iv05"
                style="@style/userPartImage"
                android:background="@drawable/ic_searchsatisfaction"/>
            <TextView
                android:id="@+id/tv05"
                style="@style/exploreText"
                android:layout_toRightOf="@+id/iv05"
                android:text="满意度调查"/>
            <ImageView
                style="@style/exploreArrows"
                android:background="@drawable/ic_arrows"/>
        </RelativeLayout>
    </LinearLayout>
</LinearLayout>

style.xml:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:fitsSystemWindows">true</item>
    <item name="android:listDivider">@drawable/divider</item>
</style>
    <resources>

  • 写回答

1条回答 默认 最新

  • GuldanHu 2017-12-04 01:49
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 聚类分析或者python进行数据分析
  • ¥15 如何用visual studio code实现html页面
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?