开发者

Button beside Tabs in android

I want to create a button beside tabs in android in such a way that it should not overlap with the tabs.It is like calendar application in android which has "List" tab(for planning),"Day" tab (for each day plan) and "Month" tab(for displaying calendar).I want to add another button(Today) beside the tabs so that if I click "Today" it should display the current date incase I navigate to some other date from the tab.I tried by

Button button = new Button(this);
button.setText("Today");
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);    
tabHost.addView(button,params);

But in this case the button is overlapping th开发者_Go百科e tabs which I don't want.

Any help????

Thanks in advance


Try to put the TabWidget object which is called tabs in a LinearLayout with android:orientation="horizontal"

Now add the button to the LinearLayout instead of the tabHost.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜