I want to create a dynamic table.My problem is this that I want to use check boxes and buttons in row of table and the buttons and checkbox are custom one.I have created those using selector.xml files.And I am not getting how can I create and add my rows dynamically to my TableLayout.Plz Help
I found the solution.
Here.
Related
I am learning android development ,I want to create dynamic table rows .I don't know how to create .I want to create two table .One should static and Another should be dynamic .
I referred in internet and i saw table layout , recycler view and I don't know which is best way to do it.Please someone guid me.
I want to create a tables like this
I have tried like this only
You cannot simply create table and rows as simple as in webpages. you have to use TableLayout,TableRow and textview(for rendering text inside of it).
create no of textviews as cell and add it to TableRow(android layout) then add the tablerow and add it to TableLayout and then add tablelayout to root layout. On dynamic insertation invalidate the view to see changes
Is it possible to create a layout for an application on android from fields in a database?
I have a table in the database that contains questions and I want to generate a "form" or "layout" depending on the data that is in that table.
For example, I have question one:
as we see in the table I have the column "tipo_pregunta" which is what it will say if it is an input, checkbox, textarea, etc.
I wanted to know if it is possible or if you know some guide from which I can learn.
Yes. Of course, you can generate layout dynamically.
Create layout(LinearLayout, RelativeLayout etc) object.
Iterate database result
Create a view on checking your "tipo_pregunta" value. like(TextView, Checkbox, RadioButton etc)
Add this created view in your layout object - layoutObj.add(viewObj);
Repeat steps 3 & 4 till your database result count.
I am using a table View in my xml. Currently all the rows look the same(shown as the first table), so I want the header to be different to the following rows, such as the 1st table in the picture
I tried to set the first row as buttons but they look weird, does anyone got a idea? thanks so much for the help
this post Android TableLayout Header row may be helpful to you
they are using Tables inside tables
OR
see my answer in this post. android create textViews in tableRows programmitcally
this question author is using fixed textviews as header in xml. here you can control the textview attributes to look them like headers
then he is trying to add the table contents via program
I want to create a UI as shown in the below link:
http://i53.tinypic.com/sxksx5.jpg
According to me there can be the following approaches to do it.
There are two tables in this image. The above table should be made in the following way:
One row with two textview in one xml file. Now Inflate this UI using LayoutInflater. Draw It using a loop and set the text according to requirement.
The below table should be made in the following way:
How to make a dynamic table layout using XML
see the above link where It is advised that the 2nd table should be made using the listview.
Now I am confused that this can be made using gridvew, tablelayout, listview. Which one I should prefer and why? In my previous projects I have made this kind of UI almost in the coding. But I believe that a little change in the UI will require lot of change in the code. So I want to make the current UI using the xml. But dont know what approach would be best.
I'd suggest using a ListView. Subclass it and overload the getItem() method to render each column of the table row. You can then easily bind the listview to your data sources. you'll need to create an XML layout resource to describe a row of the table.
To show one table above another, put the listviews inside a RelativeLayout and specify attributes to position them relative to each other.
http://developer.android.com/reference/android/widget/ListView.html
http://developer.android.com/resources/tutorials/views/hello-relativelayout.html
I want to create a dynamic table whose row uses customized button which uses selector.xml file and I am not getting how to do it.
Plz Help me
Thanks in advance
You Can Inflate your layout which you want to use as a table row and by inflating you can use your customized buttons