开发者

ScrollView don't scroll?

开发者 https://www.devze.com 2023-01-30 10:39 出处:网络
I\'ve a ScrollView / RelativeLayout / FrameLayout and I inside put programmaticaly some widgets. Here is the gui xml :

I've a ScrollView / RelativeLayout / FrameLayout and I inside put programmaticaly some widgets.

Here is the gui xml :

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:background="@drawable/fond_app">
  <RelativeLayout
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  >
   <TextView
   android:id="@+id/titreAppli"
   a开发者_运维技巧ndroid:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:text="My Big Application" 
   android:textStyle="bold"
   android:textColor="#9b9b71"
   android:textSize="15dp"
   />
   <FrameLayout
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:id="@+id/out"
   android:layout_below="@id/titreAppli"
   />
  </RelativeLayout>
</ScrollView> 

In the FrameLayout, I put programaticaly another RelativeLayout, and other widgets inside.

With some widgets (text, image, buttons), I can't scroll. With other (a linearlist with text), I can scroll.

Why ? Is there a solution ?

Thanks.


First remove frame layout. You should use some other layout like relative instead of framelayout. Becasue Framelayout is not expanding and there fore scroll view is not working. If you use linear or relative then they will expand and you will be able to scroll.


Have you tried without the android:fillViewport="true" ?

0

精彩评论

暂无评论...
验证码 换一张
取 消