很大的差距我有一個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