【发布时间】:2016-04-11 23:37:58
【问题描述】:
我正在尝试将 imageview 放在 android studio 的滚动视图中,但它不允许我将 imageview 拖放到滚动视图中。
这是我的代码:
<?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:background="#ccc"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="30dp">
<LinearLayout
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#ffffff"
android:gravity="center"
android:orientation="vertical"
android:textColor="#ffffff">
<TextView
android:id="@+id/homepagetxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:textColor="#000000"
android:textStyle="italic" />
</LinearLayout>
</ScrollView>
我可以将它放在线性布局中,但它会弄乱我的屏幕布局。 但是,我不能像在线性布局结束标记之后那样把它放在滚动视图中。
将imageview放入scrollview有什么限制吗?
感谢您的友好回应。
【问题讨论】: