-
-
Save udacityandroid/462d130752ef49bbab92 to your computer and use it in GitHub Desktop.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center" | |
android:padding="4dp" | |
android:text="Team A" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center" | |
android:padding="4dp" | |
android:text="0" /> | |
<Button | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="8dp" | |
android:text="+3 Points" /> | |
<Button | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="8dp" | |
android:text="+2 Points" /> | |
<Button | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="8dp" | |
android:text="Free throw" /> | |
</LinearLayout> |
put a zero in the image view box
must put 0 in the image view to continue
can we do like this
LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="Team A" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="0" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="+3 Point" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="+2 Point" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="Free throw" />
thank you .. i did it
Hi Ladies and Gentlemen!
I started to learn how to use Github.
And because of that I also tried to save the beginning of the project(Set up)
Here is the link where you can dowload the whole project and open it in Android Studio if you have difficulties to create(Or searching the xml file only):
https://github.com/LaszloLajosT/CourtCounter.git
layout_width for the text views and buttons should be match_parent
then give the text views a gravity (not layout_gravity) of center_horizontal.
I have a issue using just gravity, according to the code above, I've used this attribute android:layout_gravity="center_horizontal".
you can use this as an alternative
android:textAlignment="center"
2 text views and 3 buttons. What am I missing? I can't continue.