Android ImageView正在关闭
我有一个包含imageView的xmlAndroid ImageView正在关闭,android,Android,我有一个包含imageView的xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/blockingLayer" android:layout_width="880px" android:layout_height="600px"> <ImageView android:la
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/blockingLayer"
android:layout_width="880px"
android:layout_height="600px">
<ImageView
android:layout_width="110px"
android:layout_height="60px"
android:id="@+id/fish_image_view"
android:visibility="visible"
android:layout_marginLeft="0px"
android:layout_marginTop="350px"
/>
</RelativeLayout>
在代码中,我得到这个imageView并在其上运行translateAnimation,从X1=10到x2=ScreenWidth,Y1&Y2=350px。这个动画在android版本2.2上运行得很好,但当我在OS 2.3/4.0上运行它时,ImageView将在平移动画过程中在屏幕上的某些点上关闭并消失
我不明白这是怎么回事。如有答复,将不胜感激 不要使用“px”。将其更改为“dip”
来源于此,
像素-对应于屏幕上的实际像素
dp密度无关像素-基于
屏幕的物理密度。这些单位相对于160 dpi
屏幕,所以在160 dpi的屏幕上,一个dp是一个像素。比例
像素的dp将随屏幕密度而变化,但不一定
成正比。注意:编译器同时接受“dip”和“dp”,
虽然“dp”与“sp”更为一致
不要使用“px”。将其更改为“dip”
来源于此,
像素-对应于屏幕上的实际像素
dp密度无关像素-基于
屏幕的物理密度。这些单位相对于160 dpi
屏幕,所以在160 dpi的屏幕上,一个dp是一个像素。比例
像素的dp将随屏幕密度而变化,但不一定
成正比。注意:编译器同时接受“dip”和“dp”,
虽然“dp”与“sp”更为一致
我认为,这个问题与屏幕密度无关,因为我在运行Os 2.2的不同设备上检查了这个问题,但在其他版本的Os上它失败了。我想你不明白。可能您的2.2设备的密度相同,而另一个操作系统设备的密度更大。你会在这个设备上遇到问题。我想,这个问题与屏幕密度无关,因为我在运行Os 2.2的不同设备上检查了这个问题,但在其他版本的Os上它失败了。我想你不明白。可能您的2.2设备的密度相同,而另一个操作系统设备的密度更大。而你独自一人就遇到了这个问题。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/blockingLayer"
android:layout_width="880dip"
android:layout_height="600dip">
<ImageView
android:layout_width="110dip"
android:layout_height="60dip"
android:id="@+id/fish_image_view"
android:visibility="visible"
android:layout_marginLeft="0dip"
android:layout_marginTop="350dip"
/>
</RelativeLayout>