2017-07-22 53 views
-6

如何實現下面鏈接中給出的設計。如何在我的應用程序中使用此設計?

enter image description here

我已經嘗試了不同的流佈局庫,但他們缺乏事先

+1

一個簡單的圖像按鈕可以使它完成。 –

+0

我會建議在'ScrollView'裏面使用'GridView' –

+0

對我來說就像是一個FlowLayout。 –

回答

-1

customization.Thanks這種設計包括垂直線性佈局的水平線性佈局。您可以爲背景和字體添加顏色。但要獲得該屏幕,您應該添加許多屬性。 無論如何,我建議你不要試圖複製。

+1

你是認真的嗎?告訴他不要試圖複製?這是一個荒謬的答案。 –

+0

我認爲他應該嘗試一下,他對此有所瞭解 –

+1

你有沒有聽過「模仿是最誠摯的奉承形式」的引用 - Charles Colton? –

0

你可以像這樣 像下面

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <LinearLayout 

     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 

     <Button 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_margin="5dp" 
      android:layout_weight="1" 
      android:background="@drawable/custom_button" 
      android:drawableLeft="@drawable/ic_calender" 
      android:text="button 1" /> 

     <Button 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_margin="5dp" 
      android:layout_weight="1" 
      android:background="@drawable/custom_button" 
      android:drawableLeft="@drawable/ic_calender" 
      android:text="button 1" /> 

     <Button 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_margin="5dp" 
      android:layout_weight="1" 
      android:background="@drawable/custom_button" 
      android:drawableLeft="@drawable/ic_calender" 
      android:text="button 1" /> 



    </LinearLayout> 
</LinearLayout> 

現在建立在資源這個可繪製custom_button /繪製目錄中創建佈局創建這種類型的設計

<?xml version="1.0" encoding="utf-8"?> 
<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
<item> 
    <shape android:shape="rectangle"> 
     <stroke android:width="2dp" android:color="@color/colorPrimary" /> 
     <corners android:radius="50dp" /> 
     <solid android:color="@color/colorPrimary" /> 
    </shape> 
</item> 

相關問題