2013-05-11 60 views
0

我在我的应用程序该屏幕结构:方式来最大限度地提高屏幕区域

enter image description here

哪个区域的极大浪费。主要在系统栏和动作顶栏中。
我想:

  1. 移动应用标志和称谓系统区
  2. 缩小标签
  3. 的高度移动菜单底部的操作栏

要得到像这样的东西:

enter image description here

+0

您正在使用ActionBar或ActionBar sherlock?如果您使用的是ActionBar Sherlock库,那么在您的应用程序标签集中设置'android:theme =“@ style/Theme.Sherlock”' – Pragnani 2013-05-11 11:46:08

+0

@Pragnani我不熟悉ActionBar Sherlock。我使用类ActionBar。 – ilomambo 2013-05-11 11:52:37

+0

好的,试试我的答案 – Pragnani 2013-05-11 12:01:50

回答

0

我设法隐藏主操作栏。正如在Android Developer's site描述:

If you'd like to hide the main action bar at the top, because you're using the built-in navigation tabs along with the split action bar, call setDisplayShowHomeEnabled(false) to disable the application icon in the action bar. In this case, there's now nothing left in the main action bar, so it disappears and all that’s left are the navigation tabs at the top and the action items at the bottom, as shown by the second device in figure 3.

这是必要的,但这还不够,因为主要的操作栏仍显示标题和右侧的菜单图标。需要两个步骤:

  1. 隐藏图标和标题

    setDisplayShowTitleEnabled(false); 
    
  2. 不要在onCreateOptionsMenu()

创建一个菜单现在主要的操作栏是空的,它确实自败。标签仍然显示。菜单丢失,但您可以在屏幕的某个位置创建一个按钮来充当菜单,即使您可以使用相同的图标。

标签高度
我发现标签高度可以通过XML风格控制。应用程序样式标签内添加这到styles.xml

<!-- Application theme. --> 
<style name="AppTheme" parent="AppBaseTheme"> 
    <!-- All customizations that are NOT specific to a particular API-level can go here. --> 
    <item name="android:actionBarSize">35dp</item> 
</style> 

系统栏
这似乎是在系统栏,正如它的名字建议,系统只使用,不用户。我没有找到任何线索是否可以修改那里的元素(例外是来自服务的通知图标)

0

你可以做一件事从这个TabLayout删除标题和appicon。

在AndroidManifest.xml

android:theme="@android:style/Theme.NoTitleBar"  
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 

使用您的活动使用此参数您的布局将看起来像这样看到它

enter image description here

+0

我认为TAB是操作栏标题的一部分(至少根据android开发人员网站的最新指南将它们添加为“actionbar.addTab()”);如果我禁用它,这些也会去。无论如何,我会尝试看看会发生什么。 – ilomambo 2013-05-11 11:51:53

+0

乍一看,我的应用程序崩溃了两个建议的主题。我必须进行调试才能看到这是为什么。 – ilomambo 2013-05-11 12:04:39

+0

@iolmambo显示堆栈跟踪。 – 2013-05-11 12:17:52

相关问题