EasyClick 原生UI连载十三

EasyClick 原生UI连载目录

    • EasyClick 原生UI教程
    • EasyClick 原生UI之对话框UI
      • 效果图
      • Androidstudio编辑效果
      • 对话框布局UIdialogview.xml
      • main.js 如下

EasyClick 原生UI教程

讲师:Mr-老鬼,QQ:1156346325
EasyClick 原生UI教程电梯直达
EasyClick 原生UI教程总纲

EasyClick 原生UI之对话框UI

效果图

EasyClick 原生UI连载十三_第1张图片
看这篇之前请了解下前面的几章连载系列内容连接在楼上。下面先看

Androidstudio编辑效果

EasyClick 原生UI连载十三_第2张图片

对话框布局UIdialogview.xml

EasyClick项目修改完善后的对话框布局UI


<LinearLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:android="http://schemas.android.com/apk/res/android"
              xsi:noNamespaceSchemaLocation="layout.xsd"
              android:layout_width="220dp"
              android:layout_height="150dp"
              android:orientation="horizontal"
              android:background="#FFFFFF">
    <View android:layout_width="1dp"
          android:layout_height="match_parent"
          android:background="#0080FF" />

    <LinearLayout android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:orientation="vertical">


        <LinearLayout android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:background="#0080FF"
                      android:orientation="horizontal">

            <TextView android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:gravity="center"
                      android:text="对话框标题"
                      android:textColor="#FFFFFF"
                      android:textSize="16sp" />
        LinearLayout>

        <LinearLayout android:layout_width="match_parent"
                      android:layout_height="30dp"
                      android:layout_weight="1">

            <TextView android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:gravity="center"
                      android:text="我是对话框的提示内容!"
                      android:textColor="#9D9D9D" />
        LinearLayout>

        <LinearLayout android:layout_width="match_parent"
                      android:layout_height="35dp"
                      android:background="#0080FF"
                      android:orientation="horizontal"
                      android:padding="8dp">

            <TextView   android:layout_width="0dp"
	                    android:layout_height="match_parent"
	                    android:layout_weight="1"
	                    android:background="#0080FF"
	                    android:gravity="center"
	                    android:text="确定"
	                    android:textColor="#FFFFFF"
	                    android:textSize="10sp" />

            <View android:layout_width="1dp"
                  android:layout_height="match_parent"
                  android:background="#FFFFFF" />

            <TextView   android:layout_width="0dp"
	                    android:layout_height="match_parent"
	                    android:layout_weight="1"
	                    android:background="#0080FF"
	                    android:gravity="center"
	                    android:text="取消"
	                    android:textColor="#FFFFFF"
	                    android:textSize="10sp" />
        LinearLayout>
    LinearLayout>

    <View android:layout_width="1dp"
          android:layout_height="match_parent"
          android:background="#0080FF" />
LinearLayout>

main.js 如下

function main() {
     
    // 使用xml解析出来的控件
    var dialogView= ui.parseView("dialogview.xml");
    ui.customDialog({
     
            "fullScreen": false, //  设置为非全屏
            "cancelable": true   //  可以取消
        },
        dialogView,
        function (dialog, v) {
     
            //设置各种事件 省略。。。
        }, function () {
     
            logd("........")
        })

}

main();

我是Mr-老鬼、QQ1156346325 。交流QQ群:620028786,647082990

------------------------------------------------版权声明------------------------------------------------------
本文版权所有~Mr-老鬼 ~转载请注明原文地址

免责声明:本文所有的教程仅限交流学习使用不得用于违法用途,造成的法律后果本人不承担责任。

你可能感兴趣的:(Easy,Click,原生,UI,系列,android)