开发者

How do you create a layout with rectangular buttons on the top row?

As in this image:

How do you create a layout with rectangular buttons on the top row?

![two muppets][1]

where the buttons are Main, Favorites, a开发者_开发技巧nd Help.


This is obviously a Tab Layout. Read Google's documentation and this more clear example


check this:

http://developer.android.com/resources/tutorials/views/hello-tabwidget.html


That is not the Button. It's Tab Bar that is Displayed at the Top instead of Bottom

Tab Bar aligned Top


I would recommend that you look at the Android Tab layout tutorial: http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

HOWEVER please be aware that this tutorial uses the TabActivity class, which is deprecated. The documentation for TabActivity contains a version done using Fragments, which is the way tabs should be done now: http://developer.android.com/reference/android/app/TabActivity.html

Note that if you are developing for older Android devices, you should download the v4 support library, which allows you to use Fragments on old API versions: http://developer.android.com/sdk/compatibility-library.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜