このダイアログクラスがあり、アイコンをそのタイトルに設定したい:
public class DialogMealInformation extends Dialog implements
android.view.View.OnClickListener {
Context context;
private TextView tv_information;
private Button b_ok;
private String information;
public DialogMealInformation(Context context, String information) {
// TODO Auto-generated constructor stub
super(context);
this.context = context;
this.information = information;
setContentView(R.layout.dialog_meal_information);
getWindow().setLayout(android.view.ViewGroup.LayoutParams.FILL_PARENT,
android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
setTitle("Info !");
initialize();
}
それはこのように試みました:
setTitle(R.layout.dialog_simple_header);
dialog_simple_header.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/tv_dialog_simple_header_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tv_information"
android:drawableLeft="@drawable/more_information" />
</LinearLayout>
しかし、その後のタイトルは「res / layout / dialog_simple_header.x」で、テキストだけで、アイコンは表示されません。なぜお願いしますか、解決策は何ですか、どうもありがとうございました