我在这里使用以下代码.
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread paramThread, Throwable paramThrowable) {
// Catch your exception
// Without System.exit() this will not work.
System.exit(2);
}
});
Run Code Online (Sandbox Code Playgroud)
我想在C#中使用它.但是,我无法在C#中找到这种方法的等效方法.我想用来Toast.makeText()向用户显示错误.
我有这个代码:
<ImageView
android:id="@+id/imageView3"
android:layout_gravity="center"
android:gravity="center"
android:layout_width="300dp"
android:layout_height="300dp"
android:src="@drawable/house1"
android:scaleType="fitXY" />
Run Code Online (Sandbox Code Playgroud)
我有这个代码:
<ImageView
android:id="@+id/imageView3"
android:layout_gravity="center"
android:gravity="center"
android:layout_width="300dp"
android:layout_height="300dp"
android:src="@drawable/house1"
android:scaleType="fitXY"
android:adjustViewBounds="true"/>
Run Code Online (Sandbox Code Playgroud)
但我没有看到图像输出有任何变化。
adjustViewBounds到底对图像输出做了什么?