相关疑难解决方法(0)

如何永久禁用操作栏

我可以使用以下代码隐藏蜂窝中的操作栏:

getActionBar().hide();
Run Code Online (Sandbox Code Playgroud)

但是当键盘打开并且用户复制粘贴任何内容时,操作栏会再次显示.如何永久禁用操作栏?

android android-actionbar

131
推荐指数
14
解决办法
26万
查看次数

没有标题栏Android主题

在我的应用程序中我想使用Theme.NoTitleBar,但另一方面我也不想放松Android操作系统的内部主题..我在网上搜索并找到以下答案..我修改了我的styles.xml并添加了以下代码行..

内部值/ styles.xml

<style name="Theme.Default" parent="@android:style/Theme"></style>
<style name="Theme.NoTitle" parent="@android:style/Theme.NoTitleBar"></style>
<style name="Theme.FullScreen" parent="@android:style/Theme.NoTitleBar.Fullscreen"></style>
Run Code Online (Sandbox Code Playgroud)

内部值-v11/styles.xml

<style name="Theme.Default" parent="@android:style/Theme.Holo"></style>
<style name="Theme.NoTitle" parent="@android:style/Theme.Holo.NoActionBar"></style>
<style name="Theme.FullScreen" parent="@android:style/Theme.Holo.NoActionBar.Fullscreen"></style>
Run Code Online (Sandbox Code Playgroud)

内部值-v14/styles.xml

<style name="Theme.Default" parent="@android:style/Theme.Holo.Light"></style>
<style name="Theme.NoTitle" parent="@android:style/Theme.Holo.Light.NoActionBar"></style>
<style name="Theme.FullScreen" parent="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"></style>
Run Code Online (Sandbox Code Playgroud)

在Manifest文件的应用程序标记中,我添加了一个属性:

android:theme="@style/Theme.NoTitle"
Run Code Online (Sandbox Code Playgroud)

但是当我尝试运行代码时我的应用程序中的图像变得模糊..但是当我使用以下标记时:

android:theme="@android:style/Theme.NoTitleBar"
Run Code Online (Sandbox Code Playgroud)

要么

android:theme="@android:style/Theme.Light.NoTitleBar"
Run Code Online (Sandbox Code Playgroud)

要么

android:theme="@android:style/Theme.Black.NoTitleBar"
Run Code Online (Sandbox Code Playgroud)

应用程序中的图像格式正确...但在这种情况下,我丢失了新Android操作系统上的所有主题..

请帮助我如何在不丢失图像和原生主题的情况下使用NoTitleBar主题..

布局代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mainScreen"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<include
    android:id="@+id/main_top_bar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    layout="@layout/top_bar_title" />

<RelativeLayout
    android:id="@+id/container_bar1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/main_top_bar"
    android:layout_marginTop="-3dp"
    android:background="@drawable/tab_nav_bar" >
</RelativeLayout>

<RelativeLayout
    android:id="@+id/container_bar2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/container_bar1"
    android:background="@drawable/location_nav_bar" >

    <TableLayout
        android:id="@+id/map_bar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true" …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-theme

15
推荐指数
3
解决办法
10万
查看次数