2013-08-29 114 views
-1

現在我有一個滑動菜單如下,如何將我的幻燈片菜單轉換爲foursquare菜單?

enter image description here

我想樣式像Foursquare的滑動菜單,

enter image description here

這裏是我的佈局

<RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" > 

     <Button 
      android:id="@+id/oneButton" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentTop="true" 
      android:layout_marginLeft="5dp" 
      android:layout_marginTop="5dp" 
      android:drawableLeft="@drawable/ic_dashboard" 
      android:gravity="left|center_vertical" 
      android:text="@string/duo_dashboard" /> 

     <Button 
      android:id="@+id/twoButton" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentRight="true" 
      android:layout_below="@+id/oneButton" 
      android:layout_marginLeft="5dp" 
      android:drawableLeft="@drawable/ic_settings" 
      android:gravity="left|center_vertical" 
      android:text="@string/title_settings" /> 

     <Button 
      android:id="@+id/threeButton" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentRight="true" 
      android:layout_below="@+id/twoButton" 
      android:layout_marginLeft="5dp" 
      android:drawableLeft="@drawable/ic_todo" 
      android:gravity="left|center_vertical" 
      android:text="@string/title_todo" /> 

    </RelativeLayout> 
</LinearLayout> </RelativeLayout> 
+0

你能不能達到四方資源請提供更多關於你想要做什麼的細節? 你想複製顏色嗎?或整個風格? –

+0

我想申請的風格與線影 – Sajeetharan

回答

0

只是一個原始的猜測這裏。線分路器可能可以通過divider屬性來實現。

<ListView 
     android:id="@+id/left_drawer" 
     android:layout_width="250dp" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:choiceMode="singleChoice" 
     android:divider="@drawable/gradientshape" <!--thats what im talking about--> 
     android:dividerHeight="0.5dp" /> 

凡gradientshape必須是一個漸變的XML文件,像這樣

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> 
<gradient 
    android:startColor="@color/dark_black" <!--use whatever colors you like--> 
    android:endColor="@color/light_grey" 
    android:type="linear" 
    android:angle="270" /> </shape> 

編輯:剛剛看到的顏色和線條的陰影實際上是由一個9修補圖像