Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMUZ140202 Oniel Chamburuka
5,250 Pointsbuild a weather app
i need help im stuck
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white" >
<TextView
android:id="@+id/movieTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:text=""
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
<ImageView
android:id="@+id/movieImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/movieTitle" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/movieTitle"
android:layout_centerHorizontal="true"
android:id="@+id/linearLayout">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView"
android:gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView2"
android:gravity="center_horizontal"
android:layout_weight="1" />
</LinearLayout>
</RelativeLayout>
3 Answers
durul
62,690 PointsFirst textview
android:gravity="left" android:layout_weight="1"
Second textview
android:gravity="right" android:layout_weight="1"
James Simshaw
28,738 PointsHello,
Currently, you are setting the gravity on both of the TextViews to be center_horizontal when the challenge is asking for the first one to be to the left and the second one to be to the right.
MUZ140202 Oniel Chamburuka
5,250 PointsTHANKS FOR THE HELP
MUZ140202 Oniel Chamburuka
5,250 PointsMUZ140202 Oniel Chamburuka
5,250 PointsChallenge Task 1 of 1
Now we want to change the gravity for the contents of each TextView in the LinearLayout. Set the gravity of the first one to align to the left side and set the second one to align to the right side. Use the documentation for help on which value to use.