- Go to Build.gradle file
- Add implementation 'androidx.cardview:cardview:1.0.0'
- Open activity_main.xml
- Make changes as per your desired layout.
- User RelativeLayout, ScrollView, CardView and different other android:layout properties to arrange your layout as per requirement.
- It will be easier to try out different things initially to adjust settings and view its impact.
- Two things to remember while trying out different layouts:
- Use unique IDs for each layout element so that you can identify the items earmarked by respective IDs using findViewById() function.
- Make best use of different alignment properties like layout_width, layout_height, layout_marginTop, layout_marginBottom etc
- A note of different layouts in most simple words
- RelativeLayout: Used to align other layout elements like TextView / ImageView
- ScrollView: This is required to allow scrolling of Android Desktop
- CardView: A beautiful design element, used as a container for ImageView / TextView etc
- ImageView: Placeholder to display images on SmartPhone
- TextView: Placeholder to display Text
- Button: A simple button used to create onClickEvent listener.
For more details, please follow this Step-by-Step tutorial.
Comments
Post a Comment