Android 操作栏位于底部而不是顶部

Android 操作栏位于底部而不是顶部,android,Android,我正在开发一个应用程序,它需要在底部设置一个动作栏,而不是默认的顶部(不是拆分动作栏) 我的应用程序在横向模式下运行,它用于汽车,我需要在底部有一个操作栏,因为它更容易使用 可以将操作栏移到底部吗?不可能有“打开”按钮的操作栏。尝试实现自定义视图。如果您的应用程序用于汽车,请尝试使用仪表板设计模式。 可能重复: 是否可以将操作栏移到底部 不,对不起。您必须摆脱默认的操作栏(例如,使用主题.NoActionBar),并在底部创建您自己的活动使用的“汽车栏”。是。在这种情况下是不可能的。与此相反,使

我正在开发一个应用程序,它需要在底部设置一个动作栏,而不是默认的顶部(不是拆分动作栏)

我的应用程序在横向模式下运行,它用于汽车,我需要在底部有一个操作栏,因为它更容易使用


可以将操作栏移到底部吗?

不可能有“打开”按钮的操作栏。尝试实现自定义视图。如果您的应用程序用于汽车,请尝试使用仪表板设计模式。 可能重复:

是否可以将操作栏移到底部


不,对不起。您必须摆脱默认的操作栏(例如,使用
主题.NoActionBar
),并在底部创建您自己的活动使用的“汽车栏”。

是。在这种情况下是不可能的。与此相反,使用pop窗口创建类似页脚和菜单项的布局

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tabhost);
    init();
    popupInit();

}

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub

     //Creating the instance of PopupMenu  
    PopupMenu popup = new PopupMenu(TestingActivity.this,v);  
    //Inflating the Popup using xml file  
    popup.getMenuInflater().inflate(R.menu.main, popup.getMenu());  

    //registering popup with OnMenuItemClickListener  
    popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {  
     public boolean onMenuItemClick(MenuItem item) {  
          Toast.makeText(TestingActivity.this,"You Clicked : ",Toast.LENGTH_SHORT).show();
      return true;  
     }  
    });  

    popup.show();//showing popup menu


}

public void init() { 
    popupButton = (Button) findViewById(R.id.popupbutton);  
    insidePopupButton = new Button(this); 
    secondPopupButton = new Button(this);
    layoutOfPopup = new LinearLayout(this); 
    insidePopupButton.setText("OK");
    secondPopupButton.setText("OK");
    //layoutOfPopup.setOrientation(1);  
    layoutOfPopup.addView(insidePopupButton); 
    layoutOfPopup.addView(secondPopupButton); 
} 

public void popupInit() { 
    popupButton.setOnClickListener(this); 
    insidePopupButton.setOnClickListener(this); 
    popupMessage = new PopupWindow(layoutOfPopup, LayoutParams.WRAP_CONTENT,
    LayoutParams.WRAP_CONTENT); 
    popupMessage.setContentView(layoutOfPopup); 
}