很大的差距我有一个HorizontalScrollView和线性布局在Android的HorizontalScrollView
<HorizontalScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/filesScrollerLayout"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</LinearLayout>
</HorizontalScrollView>
Programmaticaly我尝试添加在LinearLayout中的观点有以下方式:
LinearLayout layout = (LinearLayout)findViewById(R.id.filesScrollerLayout);
ImageView imageView1 = new ImageView(this);
ImageView imageView2 = new ImageView(this);
ImageView imageView3 = new ImageView(this);
imageView1.setImageDrawable(Drawables);
imageView2.setImageDrawable(Drawables);
imageView3.setImageDrawable(Drawables);
的问题是,在horizontalscroll视图中,图像之间存在很大差距。我只是想让图像彼此相邻。我怎样才能成功?
尝试使horizotalScrollview宽度wrap_content – 2013-02-22 17:33:05
@Mehul Ranpara我试过了,但它没有工作 – 2013-02-22 17:34:47
图像可能被缩放到比图像视图更小的尺寸。所以图像视图是彼此相邻的,但由于它们的内容较小,所以它们看起来不像。将图像上的scaleType改为fit_start之类的东西,看看是否有帮助 – dymmeh 2013-02-22 17:37:10