Not scrolling down when tableview exceeds main screen
I have a tableview having lots of datarows inside it. When I integrate the tableview with more datarows which can be seen while tableview is scrolled downwards, I can't scroll down when the widget is integrated. So, I can't see other items in tableview. If I take fixed height of Tableview then it works but I don't want to take fixed height. Any help will be appreciated.
Any help?
I don't think this might be trusted source :( I am not given attention from the developer. :(
Hello mobihunterz,
Sorry for the late response. Can you put some code ? I work with ListView, but I tried with TableView which contained a lot of rows and scrolling is possible.
Claire
Hi Claire,
extremely sorry for my late response due to my business on other priorities. The pull-to-refresh is still not working and in Android, it behaves tremendously disastrous. I will put code within few hours.
When I first tried the widget you created it was not working properly, then I had to manually assign some value to tableview height and for iPhone, it's working well. But for Android, the code stumbles down ruining the whole app. I need to declare this that my app works for both landscape and portrait in Tablet and only portrait in Handheld devices.
To access the code follow the link here: https://drive.google.com/file/d/0BwrEZRw3ujafOUxzVkJTREx1MkE/edit?usp=sharing
You can download the zip file by saving it from File menu. In this code, I have put just demo tableview which shows, how the widget works fine for iPhone and Android fails to load the same. Note: I have to support multiple densities, so, I need to enable anyDensity. In my app I can't assign fixed value for Tableview height and width, so, I took support of Platform height/width.
Let me know if you have any query.
Hi, I can't see your code today but I will look it in the week
Thanks for your prompt response. Hope I get some solution to go on with :).
Hi Claire,
Any update on this ? :(
Thanks.
You don't need callback in the index.js but in your menu.js you need to follow this:
-
In the initialization of the file put this code:
if (args.pulltorefresh) { args.pulltorefresh.setCallback(api.doRefresh); } -
In the function where you update your view you have to put this code:
if (args.pulltorefresh && data) {
args.pulltorefresh.stop(data.length * 240, 20);
}
The first argument is the length of one item of your listView/tableView. The second argument [Optional] is the subtraction of the size of the header by the size of the navbar, if you don't have any navbar don't indicate this argument.
- Add this function:
doRefresh: function(e) {
// Call your update function
},
You can read the README for more information.
If you don't succeed, don't hesitate to post a new comment
Thanks Claire, I will try your solution and will revert back to you :)
Hi Clair,
I have similar issue with android. I am using Titanium SDK 3.2.3.
When item is full on list(which is scrollview for android), I can't scroll down to see end of item.
Anything I can fix this issue?

Sorry @vatsalengg your comment was deleted after a bad manipulation. I copy/paste it : "Hi @clairecoloma , your above given code example seems ambiguous,
According to you,
if (args.pulltorefresh && data) {
args.pulltorefresh.stop(data.length * 240, 20);
}
The first argument is the length of one item of your listView/tableView.
On Android, its not working, as shown in following screenshot, table menu displayed at left allows scroll up even though content is shorter than available height, which cut first item in the menu on excess scroll up.

My question is that data.length will provide total no of items in related listView / tableView. So, you are sure that 'data.length * 240' is length of one item of related listView / tableView?
Suggest any work around or permanent solution."
My response : Yes according to me : The first argument is the length of one item of your listView/tableView. and : "The second argument [Optional] is the subtraction of the size of the header by the size of the navbar, if you don't have any navbar don't indicate this argument." In your screenshot you don't have navbar so don't put second argument and it will be ok. But indeed for the first argument 240 is the size of one item and you have to adapt this number.
Hi ansgmlen, maybe you can ajust arguments of the line :
args.pulltorefresh.stop(data.length * 240, 20);
I will try the widget with differents size of the item this week end ; and if I find a problem I will fix it.
Thanks for response Claire. I try to adjust argument number, but what ever number I put in there, it is same result. The height size changes, when it refreshed by input number. But if I set contentHeight : Ti.UI.SIZE for #container in widget.tss, it shows all the list of items. However, I can also see headerview and I can't refresh anymore. :(