Android Design Support Library With Theme.material
I would like to use the new design support library in my application beginning with the API 21. I want to use Theme.Material style but it's work only with Theme.AppCompat style. Wh
Solution 1:
TextInputLayout relies on resources/attributes in AppCompat. You need to use an AppCompat base theme.
The AppCompat themes are a parent of the Material based themes on API 21+. So, you will be using the Material theme.
Solution 2:
Add this line in gradle file :
compile 'com.android.support:design:22.2.0'
then in you *.xml file do like this :
<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_margin="10dip"android:gravity="center_vertical"android:orientation="vertical"android:padding="10dp"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_margin="10dip"android:orientation="vertical"android:weightSum="1"><android.support.design.widget.TextInputLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:paddingTop="4dip"app:hintTextAppearance="@style/textview.small"><EditTextandroid:id="@+id/et_password"style="@style/textview.medim"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginLeft="10dip"android:layout_marginRight="10dip"android:hint="@string/Password" /></android.support.design.widget.TextInputLayout></LinearLayout></LinearLayout>
update : if you want use toolbar ,you should change to use AppCompat theme ,I'confused about this
Post a Comment for "Android Design Support Library With Theme.material"