AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.content);
time_view = View.inflate(MainActivity.content, R.layout.time_long, null);
count_tiime = (TextView) time_view.findViewById(R.id.count_tiime);
count_tiime.setText(hms);
builder.setView(time_view);
builder.setCancelable(false);
builder.create().show();
可自定义 time_long.xml 布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="30dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:text="开始记录时间"
android:textColor="#33b5e5"
android:textStyle="bold"></TextView>
<TextView
android:id="@+id/start_tiime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="开始记录时间"></TextView>
</LinearLayout>
<TextView
android:id="@+id/count_tiime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="开始时间"></TextView>
</LinearLayout>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)