Layout using LinearLayout to achieve (more like this layout, before the UI to have the idea of global considerations, easy to operate), each menu is a linear block, the interior is a imageview and a TextView Two interface Click to switch each other, the following is the effect screenshot:
due to each linear block Property configurations are almost identical, so extracting them into a unified style makes it easier to reference them in an XML file. The following is a layout file snippet for the UI design:
<?xml version= "1.0" encoding= "Utf-8" ><linearlayout xmlns:android= "http://schemas.android.com/apk/res/" Android "Android:layout_width=" Match_parent "android:layout_height=" match_parent "android:orientation=" horizon
Tal "> <linearlayout android:layout_width=" wrap_content "android:layout_height=" Fill_parent " android:layout_weight= "1" android:orientation= "vertical" android:padding= "20DP" > <li Nearlayout android:layout_width= "fill_parent" android:layout_height= "Wrap_content" and
roid:orientation= "Horizontal" > <linearlayout style= "@style/menu_item_block_orange" > <imageview style= "@style/menu_item_img" android:src= "@drawable/menu_icon_mail"/> <textview, Styl E= "@style/menu_item_txt" android:text= "short message"/> </LinearLayout> <linearlayout style= "@ Style/menu_item_block_orange "android:layout_marginleft= "5DP" > <imageview style= "@style/menu_item_img" android:src= "@drawable/menu_ic On_calendar "/> <textview style=" @style/menu_item_txt "android:text=" Calendar "/> </linear
layout> </LinearLayout> <linearlayout android:layout_width= "Fill_parent" android:layout_height= "Wrap_content" android:layout_margintop= "5DP" android:orientation= "Horiz Ontal "> <linearlayout style=" @style/menu_item_block_orange "> <imageview style=" @ Style/menu_item_img "android:src=" @drawable/menu_icon_phone "/> <textview style=" @style/menu_item_tx T "android:text=" phone "/> </LinearLayout> <linearlayout style=" @style/menu_item_block_o Range "android:layout_marginleft=" 5DP "> <imageview style=" @style/menu_item_img "android:src=" @drawab Le/menu_icon_gmail "/> <textview style= "@style/menu_item_txt" android:text= "Gmail"/> </LinearLayout> </linear Layout>