我在网上查找了,有很多处理 scaling 的答案,我不知道用哪个,我使用的下面的 xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" android:layout_gravity="center">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" android:layout_gravity="center" android:layout_weight="1"/>
</LinearLayout>
如何把按钮放在中间而不用任何 stretching?