自定义TimePicker的title

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>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,558评论 25 708
  • 用两张图告诉你,为什么你的 App 会卡顿? - Android - 掘金 Cover 有什么料? 从这篇文章中你...
    hw1212阅读 12,975评论 2 59
  • 昨天我和儿子睡的都很晚,其实我并不知道他没有睡,发现一点多的时候他卧室的灯亮着,我就想着不能让孩子睡这么晚。反观自...
    李沁李沁阅读 212评论 1 1
  • 【换药】今晚是给母亲第二次换药,相对于周六晚第一次看视频学习换药,这一次技术娴熟了不少。 先给母亲倒水,第一盆水洗...
    一帘月风闲阅读 143评论 0 0
  • 下班的路上打开简书,首页一翻,总是那些毒鸡汤或者说教你如何成功的文章,他们穿插一些美丽的图片,说一些让人觉得无关痛...
    Jack_Barnes阅读 102评论 3 1