FormattedHeight Limit!

Dan Friedman dan at clearvisiontech.com
Tue Aug 7 00:08:54 EDT 2012


Rick,

Don't change the height of the field to match it's contents, set it to the display size.  For example, if your field is to *display* on the entire screen, then do this:

	set the rect of fld "ViewingField5" to the rect of this card

Then, fill it with the data.  Next, set the iOS scroller's contentRect to (the formattedRect of field "ViewingField5").  Finally, in your scrollerDidScroll message, don't set the scroll of the group containing field "ViewingField5", simply set the scroll of field "ViewingField5".  Make sense?

Works fine for me.

-Dan


> Hi Dan,
> 
> An interesting idea, however the problem is with the following line of code,
> which takes place in the preOpenCard script.
> 
>      set the height of field "ViewingField5" of this card to tHeight5
> 
> (When tHeight5 > 32768 the above line of code fails in the iOS Simulator
> and does not complete any more script statements after that line with no
> error message being generated.  At this point nothing is being executed
> on the group.  It is a variable going beyond the limit here.  Is there any way
> to make the variable bigger like a double precision integer or some such thing?)
> 
> Suggestions?
> 
> Thanks,
> 
> Rick
> 
> On Aug 6, 2012, at 5:41 PM, Dan Friedman wrote:
> 
>> Rick,
>> 
>> One thought is to not use scroll the grouped field for your iOS scroller, but rather scroll the field itself.   In your scrollerDidScroll message, scroll the field, not the scroll of the group.  This is what I use when I suspect the FormattedHeight may be larger than the allowable range.
>> 
>> Hope that helps!
>> 
>> -Dan
>> 
>> 
>>> Hi there,
>>> 
>>> I discovered that if I'm using large text
>>> in my scrolling field of size 24, and I
>>> have 1043 lines in my field, that the
>>> Height of my field using FormattedHeight
>>> equals 33,390 which apparently goes
>>> beyond a limit of 32,768 and causes
>>> an unreported error in the iOS Simulator.
>>> 
>>> I really want to use my larger font size,
>>> and I don't want to cut down on the number
>>> of lines in my field.  Any work arounds for this?
>>> 
>>> Thanks in advance,
>>> 
>>> Rick




More information about the use-livecode mailing list