stackoverflow.com/questions/3…
Java代码
LayoutInflater inflater = this.getLayoutInflater();
View dialogView = inflater.inflate(R.layout.text_layout, null);
TextView texts=(TextView) dialogView.findViewById(R.id.textss);
texts.setText("Start Time");
tpd.setCustomTitle(dialogView);
复制代码
XML布局
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp">
<TextView
android:id="@+id/textss"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
复制代码