Search Results

Search found 118 results on 5 pages for 'tablerow'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Need help with Android TableLayout alignment

    - by Ben L.
    I'm trying to build a calculator layout using TableLayout, but the last two rows aren't aligning with the rest of the layout. Is there something wrong with my layout XML? What I'm trying to do would be easier to accomplish in HTML (<td> with colspan or rowspan), so should I try converting this into a WebView? Code is as follows: (Screenshot) <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <EditText android:id="@+id/EditText01" android:layout_height="wrap_content" android:layout_width="fill_parent" /> <TableLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:stretchColumns="*"> <TableRow android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"> <Button android:id="@+id/Button08" android:textSize="16pt" android:text="^" android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="wrap_content" /> <Button android:id="@+id/Button09" android:text="÷" android:textSize="16pt" android:layout_height="fill_parent" android:layout_weight="1" android:layout_width="wrap_content" /> <Button android:id="@+id/Button10" android:text="×" android:textSize="16pt" android:layout_height="fill_parent" android:layout_weight="1" android:layout_width="wrap_content" /> <Button android:id="@+id/Button11" android:textSize="16pt" android:text="-" android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="wrap_content" /> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="2"> <LinearLayout android:layout_width="wrap_content" android:layout_height="fill_parent" android:orientation="vertical" android:layout_weight="1"> <Button android:id="@+id/Button01" android:text="7" android:textSize="16pt" android:layout_weight="1" android:layout_height="wrap_content" android:layout_width="fill_parent" /> <Button android:layout_height="wrap_content" android:textSize="16pt" android:text="4" android:id="@+id/Button05" android:layout_weight="1" android:layout_width="fill_parent" /> </LinearLayout> <LinearLayout android:layout_height="fill_parent" android:orientation="vertical" android:layout_weight="1" android:layout_width="fill_parent"> <Button android:id="@+id/Button02" android:layout_height="wrap_content" android:text="8" android:textSize="16pt" android:layout_weight="1" android:layout_width="fill_parent" /> <Button android:layout_height="wrap_content" android:textSize="16pt" android:text="5" android:id="@+id/Button06" android:layout_weight="1" android:layout_width="fill_parent" /> </LinearLayout> <LinearLayout android:layout_height="fill_parent" android:orientation="vertical" android:layout_weight="1" android:layout_width="fill_parent"> <Button android:id="@+id/Button03" android:text="9" android:textSize="16pt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" /> <Button android:textSize="16pt" android:text="6" android:id="@+id/Button07" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" /> </LinearLayout> <Button android:id="@+id/Button04" android:text="+" android:textSize="16pt" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="1" /> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="2"> <LinearLayout android:layout_width="wrap_content" android:layout_height="fill_parent" android:orientation="vertical" android:layout_weight="2"> <LinearLayout android:layout_weight="1" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <Button android:id="@+id/Button02" android:textSize="16pt" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="1" /> <Button android:textSize="16pt" android:id="@+id/Button06" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="2" /> </LinearLayout> <Button android:id="@+id/Button01" android:layout_height="wrap_content" android:textSize="16pt" android:layout_weight="1" android:layout_width="fill_parent" android:text="0" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="fill_parent" android:orientation="vertical" android:layout_weight="1"> <Button android:id="@+id/Button03" android:textSize="16pt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="3" /> <Button android:textSize="16pt" android:id="@+id/Button07" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="." /> </LinearLayout> <Button android:id="@+id/Button04" android:textSize="16pt" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="1" android:text="=" /> </TableRow> </TableLayout> </LinearLayout>

    Read the article

  • Converting listview to a composite control

    - by Paul
    The link below shows a listview composite control in its most basic form however I can't seem to extend this to what I'm trying to do. http://stackoverflow.com/questions/92689/how-to-define-listview-templates-in-code My listview has 1 tablerow with 2 fields. The first field contains 1 element whilst the second field contains 2 elements as shown below. <asp:ListView ID="lstArticle" runat="server"> <LayoutTemplate> <table id="itemPlaceholder" runat="server"> </table> </LayoutTemplate> <ItemTemplate> <div class="ctrlArticleList_rptStandardItem"> <table width="100%"> <tr> <td valign="top" class="ctrlArticleList_firstColumnWidth"> <a href="<%# GetURL(Container.DataItem) %>"> <%# GetImage(Container.DataItem)%> </a> </td> <td valign="top"> <span class="ctrlArticleList_title"> <a href="<%# GetURL(Container.DataItem) %>"> <%# DataBinder.Eval(Container.DataItem, "Title") %> </a> </span> <span class="ctrlArticleList_date"> <%# convertToShortDate(DataBinder.Eval(Container.DataItem, "ActiveDate"))%> </span> <div class="ctrlArticleList_standFirst"> <%# DataBinder.Eval(Container.DataItem, "StandFirst")%> </div> </td> </tr> </table> </div> </ItemTemplate> So to convert this I have to use the InstantiateIn method of the ITemplate for the layouttemplate and the ItemTemplate. Data is bound to the itemtemplate using the DataBinding event. My question at the moment is how do I setup the ItemTemplate class and bind the values from the above ListView ItemTemplate. This is what I've managed so far: private class LayoutTemplate : ITemplate { public void InstantiateIn(Control container) { var table = new HtmlGenericControl("table") { ID = "itemPlaceholder" }; container.Controls.Add(table); } } private class ItemTemplate : ITemplate { public void InstantiateIn(Control container) { var tableRow = new HtmlGenericControl("tr"); //first field in row var tableFieldImage = new HtmlGenericControl("td"); var imageLink = new HtmlGenericControl("a"); imageLink.ID = "imageLink"; tableRow.Controls.Add(imageLink); // second field in row var tableFieldTitle = new HtmlGenericControl("td"); var title = new HtmlGenericControl("a"); tableFieldTitle.Controls.Add(title); tableRow.Controls.Add(tableFieldTitle); //Bind the data with the controls tableRow.DataBinding += BindData; //add the controls to the container container.Controls.Add(tableRow); } public void BindData(object sender, EventArgs e) { var container = (HtmlGenericControl)sender; var dataItem = ((ListViewDataItem)container.NamingContainer).DataItem; container.Controls.Add(new Literal() { Text = dataItem.ToString() }); } One of the functions in the ListView just for an example is: public string GetURL(object objArticle) { ArticleItem articleItem = (ArticleItem)objArticle; Article article = new Article(Guid.Empty, articleItem.ContentVersionID); return GetArticleURL(article); } Summary What do I need to do to convert the following into a composite control: 1. <a href="<%# GetURL(Container.DataItem) %>"><%# GetImage(Container.DataItem)%></a> 2. <a href="<%# GetURL(Container.DataItem) %>"> <%# DataBinder.Eval(Container.DataItem, "Title") %> </a>

    Read the article

  • Parallel.For maintain input list order on output list

    - by romeozor
    I'd like some input on keeping the order of a list during heavy-duty operations that I decided to try to do in a parallel manner to see if it boosts performance. (It did!) I came up with a solution, but since this was my first attempt at anything parallel, I'd need someone to slap my hands if I did something very stupid. There's a query that returns a list of card owners, sorted by name, then by date of birth. This needs to be rendered in a table on a web page (ASP.Net WebForms). The original coder decided he would construct the table cell-by-cell (TableCell), add them to rows (TableRow), then each row to the table. So no GridView, allegedly its performance is bad, but the performance was very poor regardless :). The database query returns in no time, the most time is spent on looping through the results and adding table cells etc. I made the following method to maintain the original order of the list: private TableRow[] ComposeRows(List<CardHolder> queryResult) { int queryElementsCount = queryResult.Count(); // array with the query's size var rowArray = new TableRow[queryElementsCount]; Parallel.For(0, queryElementsCount, i => { var row = new TableRow(); var cell = new TableCell(); // various operations, including simple ones such as: cell.Text = queryResult[i].Name; row.Cells.Add(cell); // here I'm adding the current item to it's original index // to maintain order in the output list rowArray[i] = row; }); return rowArray; } So as you can see, because I'm returning a very different type of data (List<CardHolder> -> TableRow[]), I can't just simply omit the ordering from the original query to do it after the operations. Also, I also thought it would be a good idea to Dispose() the objects at the end of each loop, because the query can return a huge list and letting cell and row objects pile up in the heap could impact performance.(?) How badly did I do? Does anyone have a better solution in case mine is flawed?

    Read the article

  • Android layout issue - relative widths in percent using weight

    - by cdonner
    I am trying to assign relative widths to columns in a ListView that is in a TabHost, using layout_weight as suggested here: <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TableLayout android:id="@+id/triplist" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingTop="4px"> <TableRow> <ListView android:id="@+id/triplistview" android:layout_width="fill_parent" android:layout_height="wrap_content"/> </TableRow> <TableRow> <Button android:id="@+id/newtripbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Add Trip"/> </TableRow> [other tabs ...] My row definition has 4 columns that I would like to size as follows: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="1.0" android:padding="4px"> <TextView android:id="@+id/rowtripdate" android:layout_weight=".2" android:layout_width="0dip" android:layout_height="wrap_content" android:inputType="date"/> <TextView android:id="@+id/rowodostart" android:layout_weight=".2" android:layout_width="0dip" android:layout_height="wrap_content"/> <TextView android:id="@+id/rowodoend" android:layout_weight=".2" android:layout_width="0dip" android:layout_height="wrap_content"/> <TextView android:id="@+id/rowcomment" android:layout_weight=".4" android:layout_width="0dip" android:layout_height="wrap_content"> Unfortunately, it seems to want to fit all the columns into the space that the button occupies, as opposed to the width of the screen. Or maybe there is another constraint that I do not understand. I'd appreciate your help.

    Read the article

  • How to align Buttons in a TableLayout to different directions?

    - by Bevor
    Hello, probably I don't understand the layout properties of TableLayout yet. It doesn't seem to be possible to achieve such a flexible table like in HTML, because there are no cells. My target is it to achieve such a layout: Link to draft How can I do that? I thought about using a GridView but this doesn't seem to be useful in XML. My efforts look like this: <TableLayout android:id="@+id/tableLayout" android:layout_width="320sp" android:layout_height="fill_parent" android:layout_gravity="center_horizontal" android:gravity="bottom" android:layout_alignParentBottom="true"> <TableRow android:background="#333333" android:gravity="bottom" android:layout_width="fill_parent"> <Button android:id="@+id/btnUp" android:layout_width="60sp" android:layout_height="50sp" android:gravity="left" android:text="Lift U" /> <Button android:id="@+id/btnScreenUp" android:gravity="right" android:layout_gravity="right" android:layout_width="60sp" android:layout_height="50sp" android:text="Scrn U" /> </TableRow> <TableRow android:background="#444444" android:gravity="bottom" android:layout_gravity="right"> <Button android:id="@+id/btnDown" android:layout_width="60sp" android:layout_height="50sp" android:text="Lift D" /> <Button android:id="@+id/btnScreenLeft" android:layout_width="60sp" android:layout_height="50sp" android:gravity="right" android:layout_gravity="right" android:text="Scrn L" /> <Button android:id="@+id/btnScreenDown" android:layout_width="60sp" android:layout_height="50sp" android:gravity="right" android:layout_gravity="right" android:text="Scrn D" /> <Button android:id="@+id/btnScreenRight" android:layout_width="60sp" android:layout_height="50sp" android:gravity="right" android:layout_gravity="right" android:text="Scrn R" /> </TableRow> </TableLayout>

    Read the article

  • Using android.view.SurfaceView with a camera on part of the screen

    - by oneself
    Hi, I trying to put together an Android app that will take a picture and process it in some way. I'd like the layout to be similar to Google Goggles. Meaning, camera preview on the top, and some controls on the bottom using portrait orientation. I've built a first version using code sample from here. This works, but I want to add a button on the bottom. I've modified my main.xml to look as follows: <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="150dp" android:stretchColumns="1"> <TableRow> <android.view.SurfaceView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/preview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </TableRow> <Button android:id="@+id/snap" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Snap" /> <TableRow> </TableRow> </TableLayout> But when I run this code I get an exception: java.lang.RuntimeException: startPreview failed. When I replace the SurfaceView above with something else, e.g. a TextView, that it displays, but in landscape. How can I get a camera preview on part of the screen using portrait view? Thanks

    Read the article

  • Android layout issue - relative widths

    - by cdonner
    I am trying to assign relative widths to columns in a ListView that is in a TabHost, using layout_weight as suggested here: <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TableLayout android:id="@+id/triplist" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingTop="4px"> <TableRow> <ListView android:id="@+id/triplistview" android:layout_width="fill_parent" android:layout_height="wrap_content"/> </TableRow> <TableRow> <Button android:id="@+id/newtripbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Add Trip"/> </TableRow> [other tabs ...] My row definition has 4 columns that I would like to size as follows: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="1.0" android:padding="4px"> <TextView android:id="@+id/rowtripdate" android:layout_weight=".2" android:layout_width="0dip" android:layout_height="wrap_content" android:inputType="date"/> <TextView android:id="@+id/rowodostart" android:layout_weight=".2" android:layout_width="0dip" android:layout_height="wrap_content"/> <TextView android:id="@+id/rowodoend" android:layout_weight=".2" android:layout_width="0dip" android:layout_height="wrap_content"/> <TextView android:id="@+id/rowcomment" android:layout_weight=".4" android:layout_width="0dip" android:layout_height="wrap_content"> Unfortunately, it seems to want to fit all the column into the space that the button occupies, as opposed to the width of the screen. Or maybe there is another constraint that I do not understand. I'd appreciate your help.

    Read the article

  • How do I make Views fill the full width of their parent in my Android app?

    - by Omega
    I have the following layout defined for one of my Activities: <?xml version="1.0" encoding="utf-8"?> <TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow android:id="@+id/TableRow01" android:layout_height="wrap_content" android:layout_width="fill_parent"> <EditText android:text="Resource Name" android:id="@+id/ResourceName" android:lines="1" android:isScrollContainer="false"></EditText> </TableRow> <TableRow android:id="@+id/TableRow02" android:layout_height="wrap_content" android:layout_width="fill_parent"> <Button android:id="@+id/Tile" android:text="Tile"></Button> </TableRow> </TableLayout> The layout renders almost correctly, the only problem is that my text box and my button aren't occupying the full width of their respective rows. I've tried specifying fill_parent for the layout width properties, but to no avail, they still only occupy roughly half of the screen. Documentation overall for Android so far has been great, but there are a few scenarios like this one where I hit an invisible wall! Thanks for all the help!

    Read the article

  • Dynmically added row in TableLayout

    - by Balaji
    This is my activity class i want to add one textview to TableRow but i cannot show the textview in TableLayout. Activity import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.view.LayoutInflater; import android.view.ViewGroup.LayoutParams; import android.widget.TableLayout; import android.widget.TableRow; import android.widget.TextView; import android.widget.LinearLayout; public class TableRunTime extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TableLayout tl = (TableLayout) findViewById(R.id.arcitle_content_table); TextView txt = new TextView(this); TableRow tr = new TableRow(this); txt.setText("Book Name"); txt.setTextColor(Color.WHITE); txt.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); tr.addView(txt); tl.addView(tr, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); } } This is manifest file any one help how to show textview in TableLayout

    Read the article

  • Make buttonsize bigger for tablet? Android, Xml

    - by Cornelia G
    I have a android view with 2 buttons centered. I want to change the button sizes to be bigger when I run the app on a tablet because they look ridiculous small there since it is the same size as for the phones. How can I do this? This is my code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#e9e9e9" android:orientation="vertical" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" > <ImageView android:id="@+id/imageView1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerInParent="true" android_layout_gravity= "center" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:src="@drawable/icon_bakgrund_android"> </ImageView> <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/TableLayout01" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerInParent="true" > <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button1" android:layout_width="260dp" android:layout_height="50dp" android:background="@drawable/nybutton" android:layout_below="@+id/button2" android:text="@string/las_sollefteabladet" android:textColor="#ffffff" android:layout_centerHorizontal="true"/> </TableRow> <TableRow android:id="@+id/TableRow02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="centerCrop"> <Button android:id="@+id/button2" android:layout_width="260dp" android:layout_height="50dp" android:layout_marginTop="10dp" android:background="@drawable/nybutton" android:layout_centerInParent="true" android:text="@string/annonsorer" android:textColor="#ffffff" /> </TableRow> </TableLayout> </RelativeLayout> </RelativeLayout>

    Read the article

  • ASP.Net radio button list

    - by c11ada
    hey all im trying to create a feedback form, i have a some mock code which looks similar to this for (int i = 1; i < 3; i++) { TableRow tr = new TableRow(); Table1.Rows.Add(tr); TableCell QuestionCell = new TableCell(); // get the text for the question and stick it in the cell QuestionCell.Text = "<b>"+i+".</b> Question " + i; tr.Cells.Add(QuestionCell); TableRow tr2 = new TableRow(); Table1.Rows.Add(tr2); // create a cell for the choice TableCell ChoicesCell = new TableCell(); ChoicesCell.Width = 1000; // align the choices on the left ChoicesCell.HorizontalAlign = HorizontalAlign.Left; tr2.Cells.Add(ChoicesCell); RadioButtonList rbl = new RadioButtonList(); rbl.ID = "Radio1_" + i; ChoicesCell.Controls.Add(rbl); rbl.Items.Add("1"); rbl.Items.Add("2"); rbl.Items.Add("3"); rbl.Items.Add("4"); } obviously this code doesn't mean anything, its just to experiment on how i can do this feedback form, the problem im having now is once some one presses the submit button (there's a submit button on the form) how do i go through the table and get text from the radio buttons the user has selected ?? the feedback from in created on page_load !! thanks for any help !!

    Read the article

  • Rows added to table are not showing up

    - by Lars
    This has been asked before, but I have found no solution that worked for me yet: When adding rows to a table from code, the rows are not showing up in the application. There is one row I specified in XML, that one is showing up, but nothing below it. This is the code: public void addRow(LocationMessage locationMsg){ View messageView = theInflater.inflate(R.layout.homepage, null); TableLayout table = (TableLayout)messageView.findViewById(R.id.distanceTable); TextView senderNameTextView = new TextView(thisContext); senderNameTextView.setText(locationMsg.getSenderName()); TableRow tr = new TableRow(thisContext); tr.addView(distanceTextView); table.addView(tr); rows.addFirst(messageView); } homepage.xml contains this, I removed some elements and parameters: <?xml version="1.0" encoding="utf-8"?> <LinearLayout> <TabHost> <TabWidget /> <FrameLayout> [..] <LinearLayout> [..] <TableLayout android:id="@+id/distanceTable" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center" android:background="#DDDDDD" android:stretchColumns="1" > <TableRow> <TextView android:textColor="#000000" android:text="@string/label_device" android:layout_gravity="center" android:padding="3dip" android:textSize="18sp" /> <TextView android:textColor="#000000" android:text="@string/label_distance" android:layout_gravity="center" android:padding="3dip" android:textSize="18sp" /> <TextView android:textColor="#000000" android:text="@string/label_time" android:layout_gravity="center" android:padding="3dip" android:textSize="18sp" /> </TableRow> </TableLayout> </LinearLayout> </FrameLayout> </TabHost> </LinearLayout> Unfortunately hierarchyviewer.bat doesn't work for me in order to check if the rows are there but just not visible. In the debugger it looks fine to me.

    Read the article

  • How to set a EditText in a certain column of a TableLayout?

    - by Nick
    I have a TableLayout on one Android Activity UI. It has two columns. Now I need to add a new row, and put an EditText box in second column of that new row. And also, I want that EditText full fill the whole cell. I have some code like this: TableRow tr = new TableRow(context); EditText et = new EditText(context); et.SetMaxLines(4); etText.setLayoutParams(new TableRow.LayoutParams(1)); //set it to the second coloumn tr.addView(et); tl.addView(tr); //tl is the tableLayout It puts the EditText in the second column fine, but the EditText is too small. I tried to use etText.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); but that seems to disabled the TableRow.LayoutParams setting. I guess each control can only have one LayoutParamas setting. So, how to make the EditText as a 4 lines text editor and also make sure it is in the second column of that row? Thanks.

    Read the article

  • Button text loses allignment after clicking

    - by breathe0
    Strange things happen. I have a 4x4 button table layout, which is the following: <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/cerca"> <TableRow android:layout_width = "fill_parent" android:layout_height = "wrap_content"> <Button android:id = "@+id/btn1" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_weight="1" android:text = "Scarica POI da server" android:onClick="downloadFromServer" /> <Button android:id = "@+id/btn2" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_weight="1" android:text = "Aggiungi POI" android:onClick="goCreatePOI" /> </TableRow> <TableRow android:layout_width = "fill_parent" android:layout_height = "wrap_content"> <Button android:id = "@+id/btn3" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_weight="1" android:text = "Rimuovi i POI del server" android:onClick="removeServerPOI" /> <Button android:id = "@+id/btn4" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_weight="1" android:text = "Rimuovi i POI personali" android:onClick="removePersonalPOI" /> </TableRow> </TableLayout> This table layout is nested inside a relative layout, which is nested in a scrollview. Now, whenever i click on one of them, everytime the text inside the button change allignment: if before clicking was centered and displayed on two lines, after the click it loses its alignment and is displayed only in one row (cutting off some part of the text). Am I doing something wrong, or maybe it's a bug?

    Read the article

  • Concatenate an each loop inside another

    - by Lothar
    I want to to concatenate the results of a jquery each loop inside of another but am not getting the results I expect. $.each(data, function () { counter++; var i = 0; var singlebar; var that = this; tableRow = '<tr>' + '<td>' + this.foo + '</td>' + $.each(this.bar, function(){ singlebar = '<td>' + that.bar[i].baz + '</td>'; tableRow + singlebar; }); '</tr>'; return tableRow; }); The portion inside the nested each does not get added to the string that is returned. I can console.log(singlebar) and get the expected results in the console but I cannot concatenate those results inside the primary each loop. I have also tried: $.each(this.bar, function(){ tableRow += '<td>' + that.bar[i].baz + '</td>'; }); Which also does not add the desired content. How do I iterate over this nested data and add it in the midst of the table that the primary each statement is building?

    Read the article

  • Fancy dynamic list in Android: TableLayout vs ListView

    - by Ralkie
    There is a requirement to have not-so-trivial dynamic list, each record of which consists of several columns (texts, buttons). It should look something like: Text11 Text12 Button1 Button2 Text21 Text22 Button1 Button2 ... At first obvious way to accomplish that seemed to be TableLayout. I was expecting to have layout/styling data specified in res/layout/*.xml and to populate it with some dataset from java code (as with ListView, for which its possible to specify TextView of item in *.xml and bind it to some array using ArrayAdapter). But after playing for a while, all I found to be possible is fully populating TableLayout programatically. Still, creating TableRow by TableRow and setting layout attributes directly in java code doesn't seem elegant enough. So the questions are: Am I at the right path? Is TableLayout really best View to accomplish that? Maybe it's more appropriate to extend ListView or something else to meet such requirements? Is it possible to have TableLayout/TableRow template specified in *.xml and data bound to this template in java side?

    Read the article

  • Confused about adding multiple td's to tr using jQuery

    - by Jason
    So I have the following code: <script type="text/javascript"> $(document).ready( function () { $("#txt").click(function () { var $TableRow = $('<tr></tr>'); var $TableData = $('<td></td>'); var $TableData2 = $('<td></td>'); // Works $("#tblControls").append( $TableRow.html( $TableData.text("Test, Hello World3") ) ); </script> <div style="display: inline"> <input type="button" id="txt" value="Add TextBox" style="" /> </div> <br/> <table id="tblControls" width="100%"> </table> But why does this not add two td's to the tr? $("#tblControls").append( $TableRow.html( $TableData.text("Test, Hello World3") + $TableData2.text("Test, Hello World4") ) ); What I get is this: [object Object][object Object]

    Read the article

  • Master Page: Dynamically Adding Rows in ASP Table on Button Click event

    - by Vincent Maverick Durano
    In my previous post here, I wrote an example that demonstrates how are we going to generate table rows dynamically using ASP Table on click of the Button control. Now based on some comments in my previous example and in the forums they wanted to implement it within Masterpage. Unfortunately the code in my previous example doesn't work in Masterpage for the following main reasons: The Table is dynamically added within the Form tag and so the TextBox control will not be generated correcty in the page. The data will not be retained on each and every postbacks because the SetPreviousData() method is looking for the Table element within the Page and not on the MasterPage. The Request.Form key value should be set correctly since all controls within the master page are prefixed with the naming containter ID to prevent duplicate ids on the final rendered HTML. For example the TextBox control with the ID of TextBoxRow will turn to ID to this ctl00$MainBody$TextBoxRow. In order for the previous example to work within Masterpage then we will have to correct those three main reasons above and this post will guide you how to correct it. Suppose we have this content page declaration below:   <asp:Content ID="Content1" ContentPlaceHolderID="MainHead" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainBody" Runat="Server"> <asp:PlaceHolder ID="PlaceHolder1" runat="server"> <asp:Button ID="BTNAdd" runat="server" Text="Add New Row" OnClick="BTNAdd_Click" /> </asp:PlaceHolder> </asp:Content> As you notice I've added a PlaceHolder control within the MainBody ContentPlaceHolder. This is because we are going to generate the Table in the PlaceHolder instead of generating it within the Form element. Now since issue #1 is already corrected then let's proceed to the code beind part. Here are the full code blocks below:     using System; using System.Web.UI; using System.Web.UI.WebControls; public partial class DynamicControlDemo : System.Web.UI.Page { private int numOfRows = 1; protected void Page_Load(object sender, EventArgs e) { //Generate the Rows on Initial Load if (!Page.IsPostBack) { GenerateTable(numOfRows); } } protected void BTNAdd_Click(object sender, EventArgs e) { if (ViewState["RowsCount"] != null) { numOfRows = Convert.ToInt32(ViewState["RowsCount"].ToString()); GenerateTable(numOfRows); } } private void SetPreviousData(int rowsCount, int colsCount) { Table table = (Table)this.Page.Master.FindControl("MainBody").FindControl("Table1"); // **** if (table != null) { for (int i = 0; i < rowsCount; i++) { for (int j = 0; j < colsCount; j++) { //Extracting the Dynamic Controls from the Table TextBox tb = (TextBox)table.Rows[i].Cells[j].FindControl("TextBoxRow_" + i + "Col_" + j); //Use Request object for getting the previous data of the dynamic textbox tb.Text = Request.Form["ctl00$MainBody$TextBoxRow_" + i + "Col_" + j];//***** } } } } private void GenerateTable(int rowsCount) { //Creat the Table and Add it to the Page Table table = new Table(); table.ID = "Table1"; PlaceHolder1.Controls.Add(table);//****** //The number of Columns to be generated const int colsCount = 3;//You can changed the value of 3 based on you requirements // Now iterate through the table and add your controls for (int i = 0; i < rowsCount; i++) { TableRow row = new TableRow(); for (int j = 0; j < colsCount; j++) { TableCell cell = new TableCell(); TextBox tb = new TextBox(); // Set a unique ID for each TextBox added tb.ID = "TextBoxRow_" + i + "Col_" + j; // Add the control to the TableCell cell.Controls.Add(tb); // Add the TableCell to the TableRow row.Cells.Add(cell); } // And finally, add the TableRow to the Table table.Rows.Add(row); } //Set Previous Data on PostBacks SetPreviousData(rowsCount, colsCount); //Sore the current Rows Count in ViewState rowsCount++; ViewState["RowsCount"] = rowsCount; } }   As you observed the code is pretty much similar to the previous example except for the highlighted lines above. That's it! I hope someone find this post usefu! Technorati Tags: Dynamic Controls,ASP.NET,C#,Master Page

    Read the article

  • Open XML SDK 2.0 - Split table to new power point slide when content flows off current slide

    - by amurra
    I have a bunch of data that I need to export from a website to a power point presentation and have been using Open XML SDK 2.0 to perform this task. I have a power point presentation that I am putting through Open XML SDK 2.0 Productivity Tool to generate the template code that I can use to recreate the export. On one of those slides I have a table and the requirement is to add data to that table and break that table across multiple slides if the table exceeds the bottom of the slide. The approach I have taken is to determine the height of the table and if it exceeds the height of the slide, move that new content into the next slide. I have read Bryan and Jones blog on adding repeating data to a power point slide, but my scenario is a little different. They use the following code: A.Table tbl = current.Slide.Descendants<A.Table>().First(); A.TableRow tr = new A.TableRow(); tr.Height = heightInEmu; tr.Append(CreateDrawingCell(imageRel + imageRelId)); tr.Append(CreateTextCell(category)); tr.Append(CreateTextCell(subcategory)); tr.Append(CreateTextCell(model)); tr.Append(CreateTextCell(price.ToString())); tbl.Append(tr); imageRelId++; This won't work for me since they know what height to set the table row to since it will be the height of the image, but when adding in different amounts of text I do not know the height ahead of time so I just set tr.Heightto a default value. Here is my attempt at figuring at the table height: A.Table tbl = tableSlide.Slide.Descendants<A.Table>().First(); A.TableRow tr = new A.TableRow(); tr.Height = 370840L; tr.Append(PowerPointUtilities.CreateTextCell("This"); tr.Append(PowerPointUtilities.CreateTextCell("is")); tr.Append(PowerPointUtilities.CreateTextCell("a")); tr.Append(PowerPointUtilities.CreateTextCell("test")); tr.Append(PowerPointUtilities.CreateTextCell("Test")); tbl.Append(tr); tableSlide.Slide.Save(); long tableHeight = PowerPointUtilities.TableHeight(tbl); Here are the helper methods: public static A.TableCell CreateTextCell(string text) { A.TableCell tableCell = new A.TableCell( new A.TextBody(new A.BodyProperties(), new A.Paragraph(new A.Run(new A.Text(text)))), new A.TableCellProperties()); return tableCell; } public static Int64Value TableHeight(A.Table table) { long height = 0; foreach (var row in table.Descendants<A.TableRow>() .Where(h => h.Height.HasValue)) { height += row.Height.Value; } return height; } This correctly adds the new table row to the existing table, but when I try and get the height of the table, it returns the original height and not the new height. The new height meaning the default height I initially set and not the height after a large amount of text has been inserted. It seems the height only gets readjusted when it is opened in power point. I have also tried accessing the height of the largest table cell in the row, but can't seem to find the right property to perform that task. My question is how do you determine the height of a dynamically added table row since it doesn't seem to update the height of the row until it is opened in power point? Any other ways to determine when to split content to another slide while using Open XML SDK 2.0? I'm open to any suggestion on a better approach someone might have taken since there isn't much documentation on this subject.

    Read the article

  • android include tag - invalid layout refernce

    - by Dalibor Frivaldsky
    Hello, I'm having a problem including a different layout through the include tag in the android layout xml file. When specifing the layout reference ( @layout/... ), i'm getting a InflateException in the Eclipse ADT with the following error: InflateException: You must specifiy a valid layout reference. The layout ID @layout/func_edit_simple_calculator_toolbox is not valid. the reference should be valid, as I've selected it from the the list of my other layouts and didnt type it in. I'm using android sdk v2.1 these are the layout files func_edit_simple_calculator_toolbox.xml <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="wrap_content"> <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content"android:layout_height="wrap_content"> <Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1"></Button> <Button android:id="@+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2"></Button> <Button android:id="@+id/Button03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="3"></Button> <Button android:id="@+id/Button04" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="+"></Button> </TableRow> <TableRow android:id="@+id/TableRow02" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/Button05" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="4"></Button> <Button android:id="@+id/Button06" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="5"></Button> <Button android:id="@+id/Button07" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="6"></Button> <Button android:id="@+id/Button08" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="-"></Button> </TableRow> </TableLayout> function_editor_layout.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <com.calculoid.FunctionView android:id="@+id/function_view" android:layout_width="fill_parent" android:layout_height="fill_parent"/> <include android:id="@+id/include01" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/func_edit_simple_calculator_toolbox"></include> </LinearLayout> Does any one know what could be the problem? thanks in advance

    Read the article

  • What is the equivalent of "colspan" in an Android TableLayout?

    - by Spike Williams
    I'm using a TableLayout in Android. Right now I have one TableRow with two items in it, and, below that, a TableRow with one item it it. It renders like this: ----------------------------- | Cell 1 | Cell 2 | ----------------------------- | Cell 3 | --------------- What I want to do is make Cell 3 stretch across both upper cells, so it looks like this: ----------------------------- | Cell 1 | Cell 2 | ----------------------------- | Cell 3 | ----------------------------- In HTML I'd use a COLSPAN.... how do I make this work in Android?

    Read the article

  • How to change the button fontsize without changing button size (in android) ?

    - by cibercitizen1
    I need to have a grid (created by program, not by xml) of equally sized buttons. They display text in different sizes. The problem is that when I change the text size to a smaller size, then the button automatically resizes to be smaller than the others. Thanks, Note: the grid is created adding *TableRow*s of buttons to a TableLayout. The buttons are created and added to a TableRow tr.addView(bu, 36, 45);

    Read the article

  • Android Uncaught Exception

    - by Agrim Asthana
    09-30 02:32:31.474: D/ddm-heap(214): Got feature list request 09-30 02:32:31.634: D/AndroidRuntime(214): Shutting down VM 09-30 02:32:31.634: W/dalvikvm(214): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 09-30 02:32:31.634: E/AndroidRuntime(214): Uncaught handler: thread main exiting due to uncaught exception 09-30 02:32:31.654: E/AndroidRuntime(214): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mjcet.mjcet/com.mjcet.mjcet.MJCET}: java.lang.ClassNotFoundException: com.mjcet.mjcet.MJCET in loader dalvik.system.PathClassLoader@44e8c820 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.os.Handler.dispatchMessage(Handler.java:99) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.os.Looper.loop(Looper.java:123) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread.main(ActivityThread.java:4363) 09-30 02:32:31.654: E/AndroidRuntime(214): at java.lang.reflect.Method.invokeNative(Native Method) 09-30 02:32:31.654: E/AndroidRuntime(214): at java.lang.reflect.Method.invoke(Method.java:521) 09-30 02:32:31.654: E/AndroidRuntime(214): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 09-30 02:32:31.654: E/AndroidRuntime(214): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 09-30 02:32:31.654: E/AndroidRuntime(214): at dalvik.system.NativeStart.main(Native Method) 09-30 02:32:31.654: E/AndroidRuntime(214): Caused by: java.lang.ClassNotFoundException: com.mjcet.mjcet.MJCET in loader dalvik.system.PathClassLoader@44e8c820 09-30 02:32:31.654: E/AndroidRuntime(214): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) 09-30 02:32:31.654: E/AndroidRuntime(214): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 09-30 02:32:31.654: E/AndroidRuntime(214): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 09-30 02:32:31.654: E/AndroidRuntime(214): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409) 09-30 02:32:31.654: E/AndroidRuntime(214): ... 11 more 09-30 02:32:31.684: I/dalvikvm(214): threadid=7: reacting to signal 3 09-30 02:32:31.684: E/dalvikvm(214): Unable to open stack trace file '/data/anr/traces.txt': Permission denied the above is my debugging output for the below activities LOGINACTIVITY.java package com.agrim.mjcet; import com.agrim.mjcet.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; //import android.widget.TextView; import android.widget.Button; import android.widget.EditText; import android.view.View.OnClickListener; public class LoginActivity extends Activity { EditText txtUserName; EditText txtPassword; Button btnLogin; Button btnCancel; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setting default screen to login.xml setContentView(R.layout.main); txtUserName=(EditText)this.findViewById(R.id.txtUname); txtPassword=(EditText)this.findViewById(R.id.txtPwd); btnLogin=(Button)this.findViewById(R.id.btnLogin); btnLogin=(Button)this.findViewById(R.id.btnLogin); btnLogin.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Switching to Register screen if((txtUserName.getText().toString()).equals(txtPassword.getText().toString())) { Intent myIntent = new Intent(getApplicationContext(),SampleActivity.class); startActivityForResult(myIntent, 0); } } } ); } } SAMPLE ACTIVITY.java package com.agrim.mjcet; import com.agrim.mjcet.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.TextView; public class SampleActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set View to register.xml setContentView(R.layout.lol); TextView HomeScreen = (TextView) findViewById(R.id.back); HomeScreen.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { // Closing registration screen // Switching to Login Screen/closing register screen finish(); } }); } } and here are my 2 layouts MAIN.XML <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#000000" android:stretchColumns="1"> <TableRow> <TextView android:text="@string/user_name" android:textColor="#347235" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_marginLeft="25dip" android:layout_height="wrap_content"> </TextView> <EditText android:text="" android:inputType="text" android:id="@+id/txtUname" android:layout_weight="0.75" android:layout_width="wrap_content" android:layout_marginRight="10dip" android:layout_marginBottom="5dip" android:background="#FFFFFF" android:layout_height="wrap_content"> </EditText> </TableRow> <TableRow> <TextView android:text="@string/password" android:textColor="#347235" android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="25dip"> </TextView> <EditText android:text="" android:inputType="textPassword" android:id="@+id/txtPwd" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="10dip" android:layout_weight="1" android:background="#FFFFFF" android:gravity="center"> </EditText> </TableRow> <TableRow> <Button android:id="@+id/btnLogin" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#FFFFFF" android:layout_marginTop="25dip" android:layout_marginLeft="50dip" android:onClick="onClickMyButton" android:text="@string/login" /> <Button android:id="@+id/btnCancel" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#FFFFFF" android:layout_marginTop="25dip" android:layout_marginLeft="100dip" android:layout_marginRight="50dip" android:text="@string/cancel" /> </TableRow> <FrameLayout android:layout_width="wrap_content" android:layout_height="match_parent" > <ImageView android:layout_width="fill_parent" android:layout_height="match_parent" android:scaleType="centerInside" android:src="@drawable/logo_invert" android:contentDescription="@drawable/logo_invert"/> </FrameLayout> </TableLayout> and finally LOL.xml <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:background="#000000" android:layout_height="fill_parent" > <ImageView android:layout_width="fill_parent" android:id="@+id/back" android:layout_height="match_parent" android:scaleType="centerInside" android:src="@drawable/lol" android:contentDescription="@drawable/lol"> </ImageView> <RelativeLayout android:layout_width="match_parent" android:layout_height="138dp" android:orientation="vertical" android:gravity="bottom" > <TextView android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:text="@string/coming_soon" android:textColor="#347235" /> </RelativeLayout> </FrameLayout> I get a force close upon initialization.. and yes this is my first android app :)

    Read the article

  • Android table width queries

    - by user1653285
    I have a table layout (code below), but I have am having a bit of a problem with the width of the cells. The picture below shows the problem. There should be a white border on the right hand side of the screen. I also want the text "Auditorium" not to wrap onto a new line (I would prefer that "13th -" get put onto the new line instead, I don't want to put \n in there because then it would mean it goes onto a new line at that point on bigger screens/landscape view). How can I fix those two problems? <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#013567" > <TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:shrinkColumns="*" android:stretchColumns="*" > <TableRow android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/meeting_5" android:textColor="#fff" > </TextView> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/meeting_5_date" android:textColor="#fff" > </TextView> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/meeting_5_location" android:textColor="#fff" > </TextView> </TableRow> <TableRow android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/AGM" android:textColor="#fff" > </TextView> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/AGM_date" android:textColor="#fff" > </TextView> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/textlines" android:gravity="center" android:text="@string/AGM_location" android:textColor="#fff" > </TextView> </TableRow> </TableLayout>

    Read the article

  • How to set layout_span through code

    - by L4N0
    Hi, Does anyone know how to set/change the android:layout_span="" of an EditText in Android at runtime. I already have the EditText defined in my XML file. <TableRow android:paddingTop="20dip" android:gravity="center_horizontal"> <EditText android:layout_width="150dip" android:text="" android:layout_height="40dip" android:id="@+id/p" android:layout_span="2"></EditText></TableRow>

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >