Mobile scroller - height of the datagrid

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tomsve
Posts: 46
Joined: Tue Jan 20, 2015 5:01 pm

Mobile scroller - height of the datagrid

Post by tomsve » Thu Aug 31, 2017 10:33 am

Not sure if I set the height of the datagrid in a good way or not, for use in a mobile scroller. In some cases my datagrid will contain zero rows, and in some cases 200 rows (height > 1000 pixels). How do I change the height in a dynamic way?

Code: Select all

put  (0,0,the formattedwidth of control pName,the formattedheight of control pName) into tRect
   mobileControlSet pName, "contentRect", tRect
^^ Doesn't seem to do the trick... I've tried with both the datagrid and the group that contains the datagrid.

The only way I can solve it, is by manually calculate the total height by rowheight * number of rows, and use

Code: Select all

set the height of group "dgList" to iHeight
in openCard.

But are there any better ways?

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Mobile scroller - height of the datagrid

Post by Klaus » Thu Aug 31, 2017 11:10 am

Hi Tom,

not sure, but maybe you are looking for: the dgFormattedheight of grp "your datagrid here..." ?


Best

Klaus

tomsve
Posts: 46
Joined: Tue Jan 20, 2015 5:01 pm

Re: Mobile scroller - height of the datagrid

Post by tomsve » Thu Aug 31, 2017 2:31 pm

Thank you very much Klaus! It helped me!

Another related thing to scrolling - is it possible to make it slightly more smooth? If I compare my scroller with other apps on iPhone, other scrollers are simply more smooth.

Post Reply