Java 使用图像滚动查看Android
我想在垂直滚动视图上放置三个图像,我不知道为什么,但我只看到第三个(tuto3) 以下是xml:Java 使用图像滚动查看Android,java,android,scrollview,Java,Android,Scrollview,我想在垂直滚动视图上放置三个图像,我不知道为什么,但我只看到第三个(tuto3) 以下是xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/scrollView" >
<LinearLayout
android:id="@+id/linearLayout42"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</LinearLayout>
</ScrollView>
</LinearLayout>
您一直在
图像
上调用setBackgroundResource,而不是图像
,图像1
,图像2
,您一直在图像
上调用setBackgroundResource,而不是图像
,图像1
,而image2
您一直在image
上调用setBackgroundResource,而不是image
,image1
和image2
您一直在image
上调用setBackgroundResource,而不是image
,image1
,和image2
您考虑过使用网格视图吗?仅供参考:ActionBarActivity已被弃用-您应该使用AppCompativeActivity您考虑过使用网格视图吗?仅供参考:ActionBarActivity已被弃用-您应该使用AppCompativeActivity您考虑过使用网格视图吗?仅供参考:ActionBarActivity已被弃用-您应该使用AppCompativeActivity您考虑过使用网格视图吗?仅供参考:ActionBarActivity已被弃用-您应该使用AppCompatActivity
public class about extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.aboutlayout);
LinearLayout ll = (LinearLayout) findViewById(R.id.linearLayout42);
ImageView image = new ImageView(about.this);
image.setBackgroundResource(R.drawable.tuto1);
ll.addView(image);
ImageView image2 = new ImageView(about.this);
image.setBackgroundResource(R.drawable.tuto2);
ll.addView(image2);
ImageView image3 = new ImageView(about.this);
image.setBackgroundResource(R.drawable.tuto3);
ll.addView(image3);
}
}