我試過在裏面用linearLayout使用HorizontalScrollView。它看起來和圖片完全一樣,但我不想使用該ScrollView,因爲在啓動時會顯示滾動條,而這不是我想要的。
我也嘗試了每個視圖相互對齊的relativeLayout,但最後一個視圖被縮小,以適應剩下的小空間。
任何提示?
我試過在裏面用linearLayout使用HorizontalScrollView。它看起來和圖片完全一樣,但我不想使用該ScrollView,因爲在啓動時會顯示滾動條,而這不是我想要的。
我也嘗試了每個視圖相互對齊的relativeLayout,但最後一個視圖被縮小,以適應剩下的小空間。
任何提示?
試試這個,您可以啓用或使用該setHorizontalScrollBarEnabled()
Scrool.setHorizontalScrollBarEnabled(true)
你爲什麼不試試看類似Gallery
的視圖。只要我能想象它,我猜就足以滿足你的需求。
圖庫已被棄用。所以,推薦的方法是HorizontalScrollView。如果您希望在啓動期間不顯示滾動條,則可以打開/關閉滾動條,然後在啓動後將其打開。
該級別在API級別16中已棄用。此小組件不再支持 。其他水平滾動窗口小部件包括 支持庫中的HorizontalScrollView和ViewPager。
找到了一個解決方案:
創建一個RelativeLayout的與水平的LinearLayout內部。 RelativeLayout(最高父級),寬度爲1500dp。那麼什麼都不是。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="1500dp"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#ffffffff">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/techinc_splash_1" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/techinc_splash_1" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/techinc_splash_1" />
</LinearLayout>
</RelativeLayout>
滾動型是最佳選擇禁用滾動條?也許吧 –