2016-11-08 135 views
0

是否有可能在Appcelerator Titanium中永久隐藏Android底部导航?关于这个问题的许多问题,但没有好的解决方案加速器钛 - 隐藏导航栏android

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

谢谢。

回答

0

此方法一直为我工作,将应用程序设置为全屏,无需导航栏和标签栏。

假设你的主窗口的ID未设置或设置为“索引”,只这应该工作,那就是你已经想尽了办法:

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

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

在你app.tss或index.tss :

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

在你tiapp.xml:

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

如果问题仍然相同,尝试添加此(指定ŧ血红素)到tiapp.xml内的舱单部分的应用程序或活动标签:

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

附加信息:

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

验证,如果窗口的ID是正确的,如果有任何风格覆盖假装的一个。

添加窗口打开方法内的console.log,你可以检查是否存在所有的动作栏引用:

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(); 
      } 
     } 
    } 
} 

看看这篇文章在Appcelerator的博客:Hiding the Android ActionBar

如果”重新尝试隐藏软导航栏,我不知道它是Titanium SDK的选项,但是一旦我回答了您的问题,并且Fokke Zandbergen对此有所评论:

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

如果这一切没有工作,你可以尝试以下模块:

Appcelerator Module - Marketplace (free): Immersive view

另外,在其他问题中发现:How to hide the soft navigation bar on Android with Titanium?

+0

谢谢里卡多, –

+0

谢谢里卡多,但我遵循你的建议,控制台返回了正确答案: [INFO] :窗口 [INFO]:活动 [INFO]:行动起来吧 [INFO]:隐藏 - 试图隐藏 [WARN]:ActionBarProxy:(主)[1593,1593]动作条未启用 但是在android导航酒吧仍在显示。我希望我们讲同样的事情:我的意思是底部的Android导航(后退/主页/退出)... –

+0

Android版本:4.4.2 –