Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How To Change Scroll Height Of Tableview For Orientation Changes
Started by Screaming Leaf Mar 14 2013 11:06 PM

4 replies to this topic
tableview height scroll orientation dynamic widget
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Screaming Leaf

[GLOBAL: userInfoPane.html]
Screaming Leaf
  • Contributor

  • 144 posts
  • Corona SDK

So I have a tableview working fine in portrait view.

 

But let's say I want to support other orientations. On an orientation change to landscape, the bottom-most entries are now cutoff from view.

 

Can I change something dynamically?

 

I was thinking the bottomPadding property...



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,605 posts
  • Enterprise

I"m guessing you are using a tableView that's smaller than the screen and therefore masked.  I've not tried this but since you have to provide a width and height and a mask file, I would think it might be best to when you detect the orientation change would be to destroy the old table and re build it with a different width/height and mask file.  I'll get Danny to respond since widgets are key in his memory right now.

 

Are you using Widgets 2.0 or an earlier build?



[TOPIC: post.html]
#3

Screaming Leaf

[GLOBAL: userInfoPane.html]
Screaming Leaf
  • Contributor

  • 144 posts
  • Corona SDK

Using Widgets 2.0.

 

Currently, the list I am using goes to the bottom of the screen, so I am not using a mask.

 

Destroying it and just creating it with a new height seems like the solution.

 

I was hoping I could just change some property in the tableview instead of rebuilding it again. The bottomPadding property seemed promising, because that adjusts the bottom limit the rows can go before bouncing back.



[TOPIC: post.html]
#4

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

You can adjust the bottom padding, albeit in a currently undocumented way. Try this:
yourTableview._view._bottomPadding = newValue -- ie 50


[TOPIC: post.html]
#5

Screaming Leaf

[GLOBAL: userInfoPane.html]
Screaming Leaf
  • Contributor

  • 144 posts
  • Corona SDK

And... it works.

 

Thanks guys!




[topic_controls]
[/topic_controls]