我想知道为什么scrollView想要显示的原因。我从互联网上下载了一些图像,然后在ImageView中将其设置为Drawable但没有任何反应。当图片很小时一切正常。错误在哪里?
Funkction我填充了View:
public void setUpLayout()
{
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int height = displaymetrics.heightPixels;
int width = displaymetrics.widthPixels;
heightOfScreen = height;
heighOfImage = image.getHeight();
System.out.println("Screen" +height);
System.out.println("IMAGE" + heighOfImage);
if(heighOfImage < height)
{
imageViewSmall.setImageBitmap(image);
imageViewSmall.setVisibility(View.VISIBLE);
scrollViewImage.setEnabled(false);
}
else
{
scrollViewImage.setVisibility(View.VISIBLE);
imageViewBig.setImageBitmap(image);
//imageViewBig.setVisibility(View.VISIBLE);
scrollViewImage.setEnabled(false);
}
}
包含所有内容的XML文件查看:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gesture-image="http://schemas.polites.com/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_height="20dp"
android:layout_width="fill_parent"
android:id="@+id/textB"
android:text="dadasadsadsasddassdsdsdsadasdd"/>
<com.polites.android.GestureImageView
android:id="@+id/imageSmal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below ="@+id/textB"
android:visibility="gone"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
gesture-image:max-scale="10.0"
gesture-image:min-scale="0.0"
gesture-image:strict="false" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/imageSmal"
android:id="@+id/scrollViewImage"
android:scrollbars="none"
android:visibility="gone">
<com.polites.android.GestureImageView
android:id="@+id/imageBig"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
gesture-image:max-scale="10.0"
gesture-image:min-scale="0.0"
gesture-image:strict="false" />
</ScrollView>
<ProgressBar
android:id="@+id/imageProgressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
/>
</RelativeLayout>