私は正しいと思ったこのレイアウトコードを持っています:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="64dip"
android:background="@drawable/title_background">
<ImageView
android:layout_width="48dip"
android:layout_height="48dip"
android:layout_margin="8dip"
android:src="@drawable/title_icon" />
<ImageView
android:layout_width="128dip"
android:layout_height="32dip"
android:layout_margin="16dip"
android:src="@drawable/title_text" />
</LinearLayout>
LinearLayout の高さは 64dip で、最初の ImageView の高さは 48dip です。私がずっと前に学んだ数学から、8dip のマージンは完全に一致するでしょう。しかし、私のImageViewsが一番下で切り取られているので、そうではありません。これはカスタム タイトルバー用で、テーマの 64dip に一致するように android:windowTitleSize を設定しました。
タイトルバーにある種の隠しパディングがありますか? もしそうなら、それはどのくらいのサイズですか?