1
即时通讯工具试图做的是将一个ImageView(线性布局)紧挨着activity.i的标题栏尝试使用android:scaleType="fitStart
“这只是一点点移动imageview。我是一个初学者我不知道android如何处理不同屏幕尺寸的图像视图和其他组件的位置,我希望imageview占用相同的空间量和相同的宽高比和固定的位置,而不管设备屏幕或图像大小还有其他的意见(对照组),我应该怎样做对齐图像查看刚刚标题栏
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:scaleType="fitStart"
android:layout_height="355dp"
android:src="@drawable/jellyfish" />
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="262dp"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:onClick="clickme"
/>
</LinearLayout>
由于只是工作,那我的第二个问题将图像和控制占用在不同screensizes类似的方式的空间? – techno
这与屏幕密度无关,所以答案是肯定的:)但是,您应该考虑将图像资源的多个版本提供给所有支持的屏幕密度。 – woot