2012-09-18 60 views
0

我正在開發一個應用程序,它需要底部的操作欄而不是默認頂部(而不是分割操作欄)。底部而不是頂部的操作欄

我的應用程序在橫向模式下運行,並在汽車中使用,我需要底部的操作欄,因爲它更易於使用。

是否可以將操作欄移動到底部?

回答

0

是否可以將操作欄移動到底部?

不,對不起。您將不得不擺脫默認操作欄(例如,使用Theme.NoActionBar)並創建您的活動在底部使用的自己的「汽車欄」。

0

是的。在這種情況下是不可能的。而不是使頁腳和菜單項目使用彈出窗口。

@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); 
} 
相關問題