• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Layout issues

 
John Kwest
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, i need a little help here.

My issue is that I have a layout that requires 5 buttons on the side that will be set to which values to look at. I have gotten the 5 buttons to align up and down just like I want, and have a new linear layout to the right with a text view that will be redrawn many times to show data. The problem is that every redraw of the text view creates 5 buttons inside of it....

Note, i have also tried this with tablelayout

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" androidrientation="horizontal" android:baselineAligned="false" android:layout_height="fill_parent">
<LinearLayout android:id="@+id/linearLayout1" android:layout_height="match_parent" android:layout_width="wrap_content" androidrientation="vertical">
<Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:text="Button" android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:text="Button" android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</LinearLayout>
<TextView android:text="TextView" android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/job_text"></TextView>

</LinearLayout>
 
Pratik Goswami
Ranch Hand
Posts: 136
Android Chrome Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, John.
Can you post a snapshot of what you exactly want. I feel that there is everything okay with Layout XML.
The problem is that every redraw of the text view creates 5 buttons inside of it....


I didn't understand what does it mean ?

Thanks
Pratik Goswami
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using an Adapter? Have you implemented Adapter.getView()? If so, what is the code in that method?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic