0

I am adding TextView into ScrollView.

Space between text views should be scalable.

I mean that if device is small then space should be smaller that if device is bigger.

Maybe i should look at ScrollView size ant scale TextView depending on it ?

Or there are some way how this is doing ? I am creating my TextView programmically.

Thanks.

Streetboy
  • 4,351
  • 12
  • 56
  • 101

3 Answers3

0

You can't add more then one child views in scrollview. Scrollview doesn't support multiple childs. Follow this:

http://developer.android.com/reference/android/widget/ScrollView.html

and

http://developer.android.com/resources/tutorials/views/index.html

Awais Tariq
  • 7,724
  • 5
  • 31
  • 54
0

You should use STYLES.XML when creating all the content of the layout you'll use inside the scrollview. If you've all the configuration of your layout inside styles, you can modify the style to fit the different screen sizes (well, one styles.xml file per screen size).

You need to create a values folder for each screensize you use/need and put inside a styles.xml file with its personalized configuration:

 values  //default .In this case, it'll be used instead of the normal-size
 values-small
 values-large
 values-xlarge

If you need more screensizes check https://stackoverflow.com/a/10426483/1140648

Community
  • 1
  • 1
Jordi
  • 616
  • 2
  • 9
  • 16
0
Use this code in your manifest.xml file.

This will work

<supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:resizeable="true"
        android:smallScreens="true" />