+1
Under review
tableview tutorials? Issues with scrolling and sizing
Any robust samples with tableview utilized as a pager? I'm using tableview just like you normally would have a pdf pager, but I'm having some sizing issues, back scrolling issues, and scroll orientation issues.
Can rowheight be defined for landscape and portrait view as diff values?
Can rowheight be defined for landscape and portrait view as diff values?
Customer support service by UserEcho
Also, in portrait view I am constricted by the 768 rowheight, where in the view, I need it to be 1024.
My Class
My tableview
<class name="pageItem">
<panel name="[param:name]" lwidth="512" lheight="768" width="1024" height="768" style="bgRed" valign="center">
<image name="pageImg" source="[param:imgSrc]" lwidth="512" lheight="768" width="768" height="1024"></image>
</panel>
</class>
<class name="table1">
<tableview name="mag" alias="MAG1" onclickup="showNav" width="100%" height="100%" rowheight="768" datasource="pagesFeed" orientation="horizontal" paginate="no">
<object datasource="pagesFeed" class="pageItem" name="page-[param:id]" imgSrc="[param:image]"></object>
</tableview>
</class>
<class name="table2"></class>
<tableview name="mag" alias="MAG2" onclickup="showNav" width="100%" height="100%" rowheight="1024" datasource="pagesFeed" orientation="horizontal" paginate="no">
<object datasource="pagesFeed" class="pageItem" name="page-[param:id]" imgSrc="[param:image]"></object>
</tableview>
<action name="create">
<if lhs="[system:orientation]" operator="e" rhs="landscape">
<create class="table2" target="..."/>
<delete target="MAG1"/>
</if>
<if lhs="[system:orientation]" operator="e" rhs="portrait">
<create class="table1" target="..."/>
<delete target="MAG2"/>
</if>
</action>
Is this a project that I am a collaborator on? With all the images in the wire, it is hard to test.
Is your datasource appearing initially prior to rotating the device? I can see that the actions are firing on rotate, but I am not seeing a datasource at all, so it is hard to tell if the data is missing or just not getting pulled from your sources.
If you can share the project with me that might help.
Is there a particular email address I should use to invite you to collaborate?
Taking a deeper dive into the code and reviewing your requests I have made the following determinations.
First of all, my apologies. It escaped me that you were trying to use a tableview horizontally. This is not allowed. Only a pager and a list can function both vertically and horizontally. A tableview is limited to vertical only. This is a limitation by Apple.
This leaves you with the option of using a list view or going back to using a PDF. If you use a list, then you will have to reduce the size of your images to something more manageable to load all at once.
It looks like you are using images that are already stored in your app. Is this by design? If so you could also consider using a create and delete to call images open as you use them. Here is an example of that.
<pager name="mag" alias="MAG" width="100%" height="100%" orientation="horizontal" paginate="yes">
<image width="100%" name="page1" source="pageimages/page-1.jpeg"></image>
<image width="100%" name="page2" alias="2" _alias="2" source="pageimages/page-1.jpeg" suppress="yes" onscrollto="load" onscrollaway="unload"></image>
<image width="100%" name="page3" alias="3" _alias="3" source="pageimages/page-1.jpeg" suppress="yes" onscrollto="load" onscrollaway="unload"></image>
<image width="100%" name="page4" alias="4" _alias="4" source="pageimages/page-4.jpeg" suppress="yes" onscrollto="load" onscrollaway="unload"></image>
<image width="100%" name="page5" alias="5" _alias="5" source="pageimages/page-5.jpeg" suppress="yes" onscrollto="load" onscrollaway="unload">
</pager>
<action name="load">
<load target="_alias"/>
</action>
<action name="unload">
<unload target="_alias"/>
</action>
We definitely won't want to use pdf since it is not compatible with android, so I'll try the load/unload method with a list. Hopefully that works out. I will let you know how everything goes.
Thanks
On another note:
Is there a way to target every odd number of the datasource? When within landscape view, I would like to have the pages stacked up next to each other so that they paginate like spreads.
Example:
image with id of 3, rightof="2"
image with id of 5, rightof="4"
etc
This way you could use 2 lists, one for odd and one for even results.
Also your loadPage1 action doesn't seem to be targeting any objects that are defined in the main.wire. I am not seeing that.
Start there and then we will see where you are at.
Thanks.
Process:
-run createList action
-creates testList class, which uses pagesFeed as datasource.
(I simply want to display the page id large within the view, but im not even getting that information.)
There is no problem with the datasource b/c it was working fine when I was just using a single list for each orientation. The problem of losing my data began happening when I started creating a new list based on orientation.
I use loadPage1 to load the first page (image) of the magazine, since my pages are loaded onscrollto. Im not using it in this test scenario, however.
I will get back to you. Thanks.