creating layout on android studio


step 1
1 .open your android app
2.create a new project
3.select the empty activity and click next
4.fill the required details and finish.
step2 open layout editor
1.in the project window, go to app>res>layouts
2.open the activity.xml file

tep 3: Choose a Layout Type

You can choose from several layout types depending on your needs:

  • LinearLayout: Arranges children in a single row or column.
  • RelativeLayout: Positions children relative to each other.
  • ConstraintLayout: Allows flexible positioning using constraints.
  • FrameLayout: Stacks children on top of each other.
step 4 add views

TextView
ImageView
Button


step 5 add attributes
example(TextView)
android:text="hello world"
android:textSize="34sp"
android:textcolor="@android:color/black"
etc.


Comments

Popular posts from this blog

java guide for beginners

File handling in java

CODING IN WORDS