2

このコードをカスタム ダイアログ タイトルの XML レイアウトに使用します

 public class UtilityDialog extends Dialog
 {
  onCreate(Bundle savedInstanceState)
  {
....
....
....
  getWindow().requestFeature(Window.FEATURE_CUSTOM_TITLE);
  getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.dialog_title);
  setContentView(content);
  }
 }

動作しますが、タイトルの高さが小さすぎて、R.layout.dialog_title の UI 要素が含まれていません

ここに画像の説明を入力

R.layout.dialog_title -->

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="65dip"
    android:padding="2dip"
    android:background="@android:color/transparent">

    <ImageView
        android:id="@+id/logoImage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:src="@drawable/logo" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="Cellalert" />

</RelativeLayout>
4

0 に答える 0