Android Question Changing text size of label in Scrollview, text no longer fits

Discussion in 'Android Questions' started by Albi, Mar 19, 2015.

  1. Albi

    Albi Active Member Licensed User

    Hello,

    I used Klaus's LongText example to build a scrollview with text (found here).

    However, when I change the text size of the text in the label, it no longer fits! I tried increasing the height of the label in the designer but this didn't have any effect.
    This was the only line of code I added to that example.
    Code:
    lblText.TextSize = 20
    I couldn't find any similar problems when searching on the forum, so if anyone has any ideas for how to help that would be great.
     
  2. Inman

    Inman Well-Known Member Licensed User

    When you changed the height of the label, did you change the height of scrollview.panel accordingly as well?
     
  3. klaus

    klaus Expert Licensed User

    Which project do you use.
    Without seeing your code it's impossible to give a concrete advice.
    Can you upload a small project showing the problem.

    Did you have a look at this example LongText, it shows texts with different fonts and sizes ?
     
  4. Albi

    Albi Active Member Licensed User

    Thanks for the reply, I used that exact example which you made and linked to. Where are the texts with different fonts and sizes located?
    in that example, with top set to -275 the upper lines of the label don't appear (screenshot attached) and there's a gap at the bottom.
    with top set to 30 (so it's below the title label), the top text line is perfect, but the bottom lines don't appear (line 192 is as far as it goes)

    I haven't changed anything on the scrollview panel because why should that matter when that's the box within which the scrolling will occur?
     

    Attached Files:

  5. klaus

    klaus Expert Licensed User

    Sorry, the link in my post is wrong one.
    The examples are quite old.
    Attached you find a working example.
     

    Attached Files:

    Albi likes this.
  6. Albi

    Albi Active Member Licensed User

    great, thanks, i've just run it and it works on my phone! i'll go through that and hope to be able to get it to work in my app...

    edit: I've had time to go through it and update my app and it now works beautifully. thank you ever so much klaus!
     
    Last edited: Mar 20, 2015
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice