2017-02-23 72 views
-2

你如何實現「材料看」與Android上的不同形式的控制?怎麼辦形式的物質形式

我見過漂浮標籤和edittext的例子,但是關於如何創建Spinners,RadioButtons,節分隔符等,以及一般的任何形式的材質外觀都沒有多少信息。

+0

看到官方文檔的其餘部分:https://開頭開發商.android.com /設計/材料/ index.html中 – rafsanahmad007

回答

0

讓你活動的AppCompatActivity後裔。然後,您使用的所有小部件將自動替換爲其實施的AppCompat

對於AppCompatActivity你應該添加在build.gradle文件項目:

compile "com.android.support:appcompat-v7:$supportLibVersion" 

目前,最新的supportLibVersion爲25.2.0。因此,

compile "com.android.support:appcompat-v7:25.2.0" 
0

我想你不喜歡,因爲這是一個非常普遍的問題。 我會幫你,喜歡你的帖子,

至於你的問題 這就非常非常一般questino 比如,你可以對文本的意見能有更多的「材料設計」的樣子做的,你可以在他們包裹風格像這樣的:

<android.support.design.widget.TextInputLayout 
android:id="@+id/input_layout_password" 
android:layout_width="match_parent" 
android:layout_height="wrap_content"> 

     <EditText 
      android:id="@+id/input_password" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:hint="@string/hint_email" /> 

</android.support.design.widget.TextInputLayout> 

爲你只需要谷歌如何風格的每個元素以滿足您的具體佈局和谷歌的材料設計guidlines