简体   繁体   English

Android应用程序顶部和底部的ActionBar

[英]ActionBar on the TOP and BOTTOM on Android App

I'm developing an Android app and I want to have 2 ActionBar (one on the top and another on the bottom) like this: http://developer.android.com/design/media/action_bar_pattern_considerations.png 我正在开发一个Android应用,我想要这样的2个ActionBar(顶部位于顶部,底部位于另一个): http : //developer.android.com/design/media/action_bar_pattern_considerations.png

I'm using Actionbar Sherlock and for now I created only the top ActionBar. 我使用的是Actionbar Sherlock ,现在仅创建顶部的ActionBar。 I serched in the web, but I didn't find a solution yet, only some piece of code. 我在网上闲逛,但还没有找到解决方案,只有一段代码。

Can anyone help? 有人可以帮忙吗?

try this... 尝试这个...

public class MainActivity extends SherlockActivity {

    private View contentView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        contentView = getLayoutInflater().inflate(R.layout.activity_main, null);
        setContentView(contentView);
        LinearLayout layout = (LinearLayout) contentView.getParent().getParent();
        View view = layout.getChildAt(0);
        layout.removeViewAt(0);
        layout.addView(view);
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM