开发者

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

开发者 https://www.devze.com 2023-03-27 22:55 出处:网络
As in this image: ![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 examplecheck th

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

精彩评论

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