AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.content);//  加载布局  MainActivity.content  对应  MainActivity.thistime_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(true); 对应点击外部可关闭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>

更多相关文章

  1. Android(安卓)Fragment和ViewPage 实现简易可滑动Tab
  2. [Android] 环境配置之Android(安卓)Studio开发NDK
  3. android 4.0.3 设置时间无法更新到RTC
  4. android 如何判断软件是否第一次运行?
  5. android studio :com.android.support:appcompat-v7:21.+ 报错
  6. [Android] 环境配置之Android(安卓)Studio开发NDK
  7. [Android] 环境配置之Android(安卓)Studio开发NDK
  8. virtualbox 安装android设置分辨率(自定义)
  9. android 学习笔记(三)

随机推荐

  1. Android仿照淘宝,京东,当当购物平台
  2. Android(安卓)Screen Monitor使用
  3. android Launcher Demo小结
  4. Android动画循环弹动cycleInterpolator
  5. Android中Activity共享变量的另一方法:App
  6. 字符串,数组api实例演示
  7. flex布局与grid布局知识点
  8. 动漫手绘线稿怎么画?教你画好手绘线稿
  9. JavaScript基础语法(一)(变量、数据类型)
  10. 1. 实例演示classList对象 2. 使用blur事