Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Persist scrollview height

ANSWERED

I have a scrollview item in my index.gui that I have set the height to 500 on.

I have some textInputs in my app settings. When they are filled out it adjusts the scrollview height accordingly up to a height of 700.

So if if:

If inuput A is filled out - Scrollview height is set to 550

If inuput B is filled out - Scrollview height is set to 600

If inuput C is filled out - Scrollview height is set to 650

 

I also have it set to work in reverse if the settings are cleared the scrollview height returns accordingly to 500.

I am writing all the inputs to a json file on the device.

All fo this is working great until I turn bluetooth off (effectivley severing the link) and the app pulls the data from the json file that was written. When I launch the app free from the device, the scrollview height is set the default (500) instead of what was last recorded (650 for example).

 

Is there a way to write the current scrollview height to the json file, so that if it loses connection with the phone it will know what height it should be?

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Found the answer myself.

When writing the file, declare the scrollview and assign it a json key and value. Then read that value on startup.

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

Found the answer myself.

When writing the file, declare the scrollview and assign it a json key and value. Then read that value on startup.

Best Answer
0 Votes