Java 指向带有缩放功能的ImageView的按钮链接
我正在尝试创建一个指向ImageView的链接按钮,它可以工作,但没有缩放,在此之前,只有当你在手机上运行它时,它才可以工作。当它没有链接按钮时,我有代码,这是错误的!有人和eclipse中的一样吗 编辑: mapslocations.xmlJava 指向带有缩放功能的ImageView的按钮链接,java,android,xml,eclipse,Java,Android,Xml,Eclipse,我正在尝试创建一个指向ImageView的链接按钮,它可以工作,但没有缩放,在此之前,只有当你在手机上运行它时,它才可以工作。当它没有链接按钮时,我有代码,这是错误的!有人和eclipse中的一样吗 编辑: mapslocations.xml <Button android:id="@+id/pslook1" android:layout_width="fill_parent" android:layout_height="
<Button
android:id="@+id/pslook1"
android:layout_width="fill_parent"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_weight="1"
android:gravity="center"
android:text="Map"
android:textSize="10sp"
android:textStyle="italic" />
imageview1.xml
<ImageView
android:id="@+id/pslook1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="matrix"
android:src="@drawable/powerstationwallmap" />
我认为您使用的是来自的代码。java为什么不使用代码来更改布局呢。它有官方文件。请仔细阅读此文档中的所有内容,如果问题仍然存在,请告诉我,以便我编辑此文档以获得动画布局更改的代码。这两个都没有帮助:其中一个在Android Studiot上第一个,有没有办法在eclipse上运行它?我将在接下来的几分钟内为您提供执行此操作的代码。如果您希望在eclipse中拥有android studio文件,您首先需要创建一个新的应用程序项目并复制包括库在内的文件。
<ImageView
android:id="@+id/pslook1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="matrix"
android:src="@drawable/powerstationwallmap" />
package com.f.fa;
import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
public class PagePowerstation extends Activity {
Button imageview1;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.imageview1);
}
}