【问题标题】:HorizontalScrollView android Doesnt work very wellHorizo​​ntalScrollView android 不能很好地工作
【发布时间】:2013-12-22 06:49:23
【问题描述】:

大家早上好

Horizo​​ntalScrollView 有问题。

我在水平线性布局中看到所有文本视图,但最后发生了问题。

horizo​​ntalScrollView 无法显示所有信息,好像视图被截断了...为什么?

horizo​​ntalScrollView 是否有最大尺寸?

部分代码xml

<ScrollView 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true">
        <HorizontalScrollView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:scrollbars="none"
            android:id="@+id/hrz_scroll"
            android:layout_weight="1"
        >
        <!--  Header  Starts-->
            <LinearLayout 
            android:id="@+id/MostraRigheInserzioneActivity_layout_linearLayout"
            android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
            android:background="@layout/header_gradient" 
            android:paddingTop="5dip"
        android:paddingBottom="5dip">    
        </LinearLayout>
    </HorizontalScrollView>
</ScrollView>

打印屏幕

帮帮我 最好的问候

【问题讨论】:

  • 请发布您的代码!!!
  • 你能给我们更多的xml代码吗? (父母和孩子)
  • 张贴截图,以便了解您的问题。
  • 发布整个 xml 代码...

标签: android size width scrollview horizontalscrollview


【解决方案1】:

为您的关注尝试这样

  <HorizontalScrollView 
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:scrollbars="none"
         android:id="@+id/hrz_scroll"
         android:layout_weight="1"
         >

试试这个:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:fillViewport="true" >

        <HorizontalScrollView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:scrollbars="none"
            android:id="@+id/hrz_scroll"
            android:layout_weight="1"
        >
        <!--  Header  Starts-->
            <LinearLayout 
            android:id="@+id/MostraRigheInserzioneActivity_layout_linearLayout"
            android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
            android:background="@layout/header_gradient" 
            android:paddingTop="5dip"
        android:paddingBottom="5dip">    
        </LinearLayout>
    </HorizontalScrollView>
</ScrollView>

【讨论】:

  • 不行,水平滚动没问题,可能是布局没有包含所有信息的问题?
  • 为什么要在滚动视图中放置水平滚动
  • 它不起作用,但现在我在原始问题中放置了一个打印屏幕
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多