How should I achive this in xml android studio java, I am a biginner in android developement, edittext looks different than this in material design components
Advertisement
Answer
The layout can simply be achieved by adding the EditText inside the CardView.
<androidx.cardview.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="16dp" app:cardElevation="6dp" app:cardCornerRadius="6dp"> <EditText android:layout_width="match_parent" android:layout_height="match_parent" android:hint="Name" android:inputType="text" android:padding="16dp" android:background="@color/white" /> </androidx.cardview.widget.CardView>
The code will give you same results EditText as shown for in the image.