在 layout.xml 中设置:
<EditText android:id="@+id/body" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1"
android:hint="Type to compose" />
<ImageButton android:id="@+id/attach"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/attach_photo" />
<Button android:id="@+id/send" android:text="@string/send"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
现在遇到的问题是:ImageButton 的顶部显示不像 Button 和 EditText 那样。Button 和EditText 上的内容显示的时候,上下填充的很好。但是,ImageButton 上面的内容似乎向上突出了。如何设置按钮的显示呢?