制作的LinearLayout滚动

制作的LinearLayout滚动

本文介绍了制作的LinearLayout滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用滚动视图,使线性布局滚动,使投入imageViews不蹬这样屏幕的其他意见和功能影像:

I am trying to make a linear layout scrollable by using a scrollView so that the images put into the imageViews don't push the other views and functions off of the screen like this:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

<TextView
    android:id="@+id/personalizetextView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/customize"
    android:textSize="30sp"
    android:gravity="center"
    android:layout_marginTop="20dip"/>

<TextView
    android:id="@+id/personalizetextviewChangeBackground"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/customizebackground"
    android:gravity="center" />

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:maxWidth="100dp"
    android:maxHeight="100dp"
    android:scaleType="fitCenter"
    android:contentDescription="@string/descForBackground"

    />

<Button
    android:id="@+id/btnChangeImage"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/change_background" />

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/set_background"
    android:id="@+id/btnSetBackground" />

 <TextView
    android:id="@+id/personalizetextviewChangeIcon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/change_icon"
    android:gravity="center" />

 <ImageView
    android:id="@+id/imageView2Icon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:maxWidth="100dp"
    android:maxHeight="100dp"
    android:scaleType="fitCenter"
    android:contentDescription="@string/descForIcon"
     />

<Button
    android:id="@+id/btnChangeImageForIcon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/change_icon" />

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/set_icon"
    android:id="@+id/btnSetIcon" />

  <Button
        android:id="@+id/btnLinkToFeedback"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="40dip"
        android:background="@null"
        android:text="@string/Send_Feedback"
        android:textColor="#21dbd4"
        android:textStyle="bold" />

        </LinearLayout>
</ScrollView>

但它只是使得它让我第一次的TextView显示出来而已。
我能做些什么来解决这个问题?

But it just makes it so that my first textView shows up and nothing else.What can I do to fix this?

推荐答案

android:orientation="vertical"

的LinearLayout 而不是滚动型;)

有关默认方向的LinearLayout 横向和您的的TextView 多行可能跨越。

The default orientation for LinearLayout is horizontal and your TextView probably spans across multiple lines.

这篇关于制作的LinearLayout滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 00:53