I'm quite new in the world of Android app development. I'm currently trying out some basic things. Currently I'm trying to achieve a floating label like the ones seen in various material design apps.
What I'm trying to do is get a CardView and place a TextInputLayout in that card.
  <android.support.v7.widget.CardView          android:layout_width="310dp"          android:layout_height="250dp"          android:layout_below="@+id/textView"          android:layout_alignRight="@+id/textView"          android:layout_alignEnd="@+id/textView"          android:layout_marginTop="13dp" >            <RelativeLayout              android:layout_width="match_parent"              android:layout_height="match_parent">              <android.support.design.widget.TextInputLayout                  android:layout_width="match_parent"                  android:layout_height="wrap_content">                    <EditText                      android:id="@+id/labeltest"                      android:layout_width="match_parent"                      android:layout_height="match_parent"                      android:hint="floating label"/>              </android.support.design.widget.TextInputLayout>          </RelativeLayout>      </android.support.v7.widget.CardView>      Now when I do this, I get a CardView like I'm supposed to get, but the TextInputLayout doesn't show up. However, I can tap it, after which it focusses and lets me enter text. (see example below)
I would like to add that I'm testing it on a virtual machine, not on an actual device.
Thanks.
 
No comments:
Post a Comment