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

scrollview-item needs height to grow with its contents; NOT require user to set a fixed height

ANSWERED

This is ridiculous; never have I used such a poor SDK. Basically, I had a simple request; display text that can be scrolled. here are the problems I found:

 

  1. Textarea won't support more than 170 characters; This is TERRIBLE design choice
  2. The screen wont scroll unless you use a scrollviewer AND add more than one item. I didnt want more than one item. I just wanted one. Text. To scroll; This is TERRIBLE design choice
  3. Since i HAD to use a scrollviewer, I did. I placed a text area inside a scrollview item. It cuts off the text unless i set a fixed height. The item height should GROW with the contents of the item. i shouldnt have to set a height; This is TERRIBLE design choice

 

Look, I just wanted to make a simple app that displays quotes and you guys made this ridiculously hard. i could do this in 5 minutes using HTML and JS (proper standards). You guys make it SO difficult. Scrolling text should be simple;

 

  1. Create Text Area
  2. It should have NO character limitation
  3. Set a scroll attribute on the Text Area
  4. Voila it scrolls!

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Hej, sometimes developing is frustrating Smiley Very Happy.

But maybe the Dynamic Textarea is a solution for your problem.

Please follow the documentation as a first approach.

 

Dynamic Textarea

The dynamic-textarea type can be used to create a <textarea> which dynamically adjusts the height depending on the length of the text content. If you change the text content, the element height will automatically re-adjust.

In the following example we define a Template Symbol containing a <textarea> and a <rect>. The <rect> will always appear 15pixels below the <textarea> even if the text content is changed at runtime...

 

https://dev.fitbit.com/build/guides/user-interface/svg/

 

View best answer in original post

Best Answer
0 Votes
6 REPLIES 6

Hej, sometimes developing is frustrating Smiley Very Happy.

But maybe the Dynamic Textarea is a solution for your problem.

Please follow the documentation as a first approach.

 

Dynamic Textarea

The dynamic-textarea type can be used to create a <textarea> which dynamically adjusts the height depending on the length of the text content. If you change the text content, the element height will automatically re-adjust.

In the following example we define a Template Symbol containing a <textarea> and a <rect>. The <rect> will always appear 15pixels below the <textarea> even if the text content is changed at runtime...

 

https://dev.fitbit.com/build/guides/user-interface/svg/

 

Best Answer
0 Votes

Oh it's mainly this SDK. I have a fair bit of experiencing programming (I made a small music production App in C# for windows phone that has more than 250,000 downloads).

 

https://www.microsoft.com/en-us/p/beats-yo/9wzdncrfjbsg

 

The decisions in this SDK are just highly questionable and not at all intuitive. Probably the worst SDK I have used in my time making apps haha. One textarea is more than capable of having all of these properties. It should be waaaay more flexible.

 

Enough ranting though. Thanks, Ill take a look at that. There doesnt seem to be any documentation on how to set the text dynamically via Javascript though. Using these "set" tags with "to" attributes doesnt have much documentation. How would that go about?

 

Would it be as simple as document.getElementById('text').to?

 

How would I reference that "to" field in the href "text" element to make changes via Javascript?

 

 

 

 

Best Answer
0 Votes

It‘s pretty simple, just select the item and set the text via JS:

 

document.getElementById(‘placeholder‘).text = ‘lorem ipsum‘;

Best Answer
0 Votes

Ok good. See there is no documentation around that, I cant assume referencing the "text" attribute of what is essentially a definition is going to work, as in the example the data actually exists inside this "set" tag which is entirely new to me. Havent seen this in C#, XAML or HTML before.

 

I'll give it a bash. Ta

Best Answer
0 Votes

It doesn't work. Still only outputs one line. Even tried adding

 

rows="20"

text-length="2000"

 

Still only outputs one row of text using the dynamic text-area

Best Answer
0 Votes

If I enter the text directly into the XAML it works. If I assign it using javascript is when it only shows one line. If that helps

 

Its basically not adjusting the height as I add new values. its remembering whatever height it was when the text that was entered into the XAML was present.

Best Answer
0 Votes