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 trialShafique Mohammed
Front End Web Development Techdegree Student 13,625 PointsI added a Button element
Hi can anyone help me please. I added button element, am bit confuse to what do I Copy and paste the TextView element
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<button
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
6 Answers
Shafique Mohammed
Front End Web Development Techdegree Student 13,625 Points<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" >
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</RelativeLayout>
Shafique Mohammed
Front End Web Development Techdegree Student 13,625 PointsWe just saw how adding a Button generates the XML for us. Now let's write the XML by hand. Start simple by adding a Button element. Copy and paste the TextView element and just change 'TextView' to 'Button'.
Lukas Baumgartner
14,817 PointsWrite:
Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
Always check your spelling ;) You wrote a small 'b' instead of a 'B'. I hope that was the problem
with a "smaller symbole" in front of Button. It somehow won't let me write it properly
Shafique Mohammed
Front End Web Development Techdegree Student 13,625 PointsI need to add a button element which can add, the bit I don't understand is what code do I need to copy and paste. I already try to copy the TextView element and change it to button this does not work
Lukas Baumgartner
14,817 PointsButton
not
button
Shafique Mohammed
Front End Web Development Techdegree Student 13,625 PointsThanks a lot Lukas it works
Lukas Baumgartner
14,817 PointsNo problem :)
If you do what they tell you you should, and you are absolutley certain that you did it right, it is most likely a spelling mistake on your side ;)
Shafique Mohammed
Front End Web Development Techdegree Student 13,625 Pointsokay thanks for the info
Lukas Baumgartner
14,817 PointsLukas Baumgartner
14,817 PointsCould you specify your question? I don't really know what you want to do...