https://stackoverflow.com/questions/31976707/how-to-set-a-custom-title-on-time-picker
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>