How do you create a layout with rectangular buttons on the top row?
As in this image:
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
精彩评论