Android Question Scrollview Table Column widths

Richard S

Member
I have downloaded and run almost all of the scrollview example apps and have not been able to find out how to set each column width in the table. The example apps seem to like 4 columns and set the width by dividing the table width by the number of columns. The app that I am making only has two columns but I need one column to be about 25%x and the second one 75%x. Having said that I am not sure that a percentage of total width will work, so I also would like to know how to set the widths by dips.
As a VERY new B4A user I love the idea of being able to look at example apps but rather then cut and paste code I cannot find documentation that explains "Why" the example code does what it does. Maybe I just don't know where to look.
Any help on setting each column width will be much appreciated.
Richard
 

Richard S

Member
Here are some of the examples that I tried. They all worked on their own but my problem is trying to adapt some of the code to my app. Maybe I'm not looking in the right places but I cannot find any documents that explain how to use a particular view. Like all the properties, methods and how to implement them.
SQLScrollViewMultiSelect
CustomScrollView
TableExample
And a few others that I can't recall.
I am not complaining, I just like to learn new things.
Richard
 
Upvote 0

Richard S

Member
Thanks for the suggestions Erel. Maybe I should have explained what I am trying to do before blundering ahead in the wrong direction.
The purpose of this activity is to read and display data from a SQLite database.
There are two main fields in the table "Title" and "Memo"
The Title field will be a small amount of text indicating what the memo is all about but the Memo field can hold a large amount of data. I only need to display a small amount of the memo text to know that this is the memo that I want to access
The table has many records and I want to be able to scroll through the records then click on the one I want and then display the full memo text in an EditText view in anther activity, again with the ability to scroll the memo text if it is too large to fit in the EditText View.
Once I am able to display the data I will want to add the ability to add a new memo, edit an existing one or delete an existing one. I also want to be able to search for a known title and memo but I think I can handle all those issues once I can display the data the way I want to.
Thanks again for all your help.
Richard
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I am convinced that Richard S does not use the Table class.

In your example you do not need the line tblItems.SetColumnsWidths.
Because the last parameter in tblItems.LoadSQLiteDB, AutomaticWidths is True, which means that the column widths are calculated automatically to fit the widest text in each column.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
Thanks Klaus, I think I changed that word to True from False as an experiment. After that my columns wrapped as I was attempting to do instead of having long 80 character lines causing scrolling hell.
Later: Whoops! No that was in my Table module. Never mind that true to false comment.
 
Last edited:
Upvote 0
Top