appcelerator钛 - 隐藏导航栏android [英] appcelerator titanium - hide navigation bar android

查看:29
本文介绍了appcelerator钛 - 隐藏导航栏android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Appcelerator Titanium 中永久隐藏 Android 底部导航?关于这个主题有很多问题,但没有很好的解决方案.

<全屏>真正的</全屏>在 tiapp 中不适用于钛 5.5.1$.index.addEventListener('open', function(e) { $.index.activity.actionBar.hide();});不起作用.'Window':{navBarHidden:true,tabBarHidden:true,fullscreen:true} 在 tss不工作等.

谢谢.

解决方案

这个方法一直对我有用,将应用设置为全屏,没有导航栏和标签栏.

假设您的主窗口的 id 未设置或设置为索引",只有这样才能工作,这是您尝试过的方法:

$.index.addEventListener('open', function(e) {$.index.activity.actionBar.hide();});

在你的 app.tss 或 index.tss 中:

窗口":{导航栏隐藏:真,tabBarHidden:真,全屏:真}

在您的 tiapp.xml 中:

true<navbar-hidden>true</navbar-hidden>

如果问题仍然存在,请尝试将此(指定主题)添加到 tiapp.xml 中清单部分的应用程序或活动标签:

android:theme="@style/Theme.NoActionBar"

附加信息:

app.tss:全局样式index.tss:索引视图的样式

验证Window的id是否正确,是否有样式覆盖了伪装的样式.

在window open方法中添加一个console.log,可以检查是否存在所有的action bar引用:

if($.index) {console.log("窗口");如果($.index.activity){console.log("活动");如果($.index.activity.actionBar){console.log("操作栏");如果($.index.activity.actionBar.hide){console.log("隐藏 - 尝试隐藏");$.index.activity.actionBar.hide();}}}}

在 Appcelerator 博客上查看这篇文章:隐藏Android 操作栏

如果您想隐藏软导航栏,我不知道 Titanium SDK 作为该选项,但是一旦我回答了一个问题,例如您的问题,Fokke Zandbergen 对此发表评论:

从 Titanium 5.2 开始,通过使用 <fullscreen>true</fullscreen>在 tiapp.xml 中.

Android 文档:使用沉浸式全屏模式>

Appcelerator 文档: 隐藏软导航栏

如果所有这些都不起作用,您可以尝试以下模块:

Appcelerator 模块 - 市场(免费):沉浸式视图

也在另一个问题中找到:如何使用 Titanium 在 Android 上隐藏软导航栏?

Is it possible to hide permanently the Android bottom navigation in Appcelerator Titanium? Many questions about this subject but no fine solutions.

<fullscreen> true </fullscreen> 
in tiapp doesn't work with titanium 5.5.1

$.index.addEventListener('open', function(e) {   $.index.activity.actionBar.hide();}); 
doesn't work.

'Window':{navBarHidden:true,tabBarHidden:true,fullscreen:true} in tss 
doesn't work etc.

Thank you.

解决方案

This method always worked for me, set the app to fullscreen without nav bar and tab bar.

Assuming your main Window's id is not set or is set to 'index', only this should work, it's the approach that you've tried:

$.index.addEventListener('open', function(e) {

    $.index.activity.actionBar.hide();
});

In your app.tss or index.tss:

"Window":{
    navBarHidden:true,
    tabBarHidden:true,
    fullscreen:true
}

In your tiapp.xml:

<fullscreen>true</fullscreen>
<navbar-hidden>true</navbar-hidden>

If the issue it still the same, try to add this (specify theme) to the application or activity tags of the manifest section inside the tiapp.xml:

android:theme="@style/Theme.NoActionBar"

Additional Info:

app.tss: global styles
index.tss: style for the index view

Verify if the id of the Window is correct, if there is any style overwriting the pretended one.

Add a console.log inside the window open method, you could check if exists all the action bar references:

if($.index) {

    console.log("window");

    if($.index.activity) {

        console.log("activity");

        if($.index.activity.actionBar) {

            console.log("action bar");

            if($.index.activity.actionBar.hide) {

                console.log("hide - try to hide");

                $.index.activity.actionBar.hide();
            }
        }
    }
}

Check out this article at the Appcelerator Blog: Hiding the Android ActionBar

If you're trying to hide the Soft Navigation Bar, I don't know it Titanium SDK as that option, but once I've answered a question, like yours, and Fokke Zandbergen comment this:

What you want is possible since Titanium 5.2 by using <fullscreen>true</fullscreen> in tiapp.xml.  

Android Documentation: Using Immersive Full-Screen Mode

Appcelerator Documentation: Hide Soft Navigation Bar

If all of this doesn't work you could try the following module:

Appcelerator Module - Marketplace (free): Immersive view

Also found in the other question: How to hide the soft navigation bar on Android with Titanium?

这篇关于appcelerator钛 - 隐藏导航栏android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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