我需要增加android gallery.i中的缩略图大小试图增加画廊高度但缩略图大小不增加。我可以调整画廊的缩略图图像吗? 这是我的xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="{relativePackage}.${activityClass}"
android:background= "@drawable/background"
android:orientation="vertical" >
<ImageView
android:id="@+id/image1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:background="#fff"
android:scaleType="fitXY"
android:layout_weight="0.80"
android:src="@drawable/image1" />
<Gallery
android:id="@+id/gallery1"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true"
android:layout_weight="0.20"
android:background="#fff"
android:scaleType="fitXY"
android:layout_height="0dp" />
</LinearLayout>
这是我的碎片。
Gallery gallery = (Gallery)rootView. findViewById(R.id.gallery1);
gallery.setAdapter(new ImageAdapter(getActivity()));
gallery.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position,long id)
{
// Toast.makeText(getBaseContext(),"pic" + (position + 1) + " selected",
// Toast.LENGTH_SHORT).show();
// display the images selected
ImageView imageView = (ImageView)rootView.findViewById(R.id.image1);
imageView.setImageResource(mThumbsIds[position]);
}
});
在这个question他要求增加imageview的大小,但我想增加缩略图视图的大小