zoukankan      html  css  js  c++  java
  • Android作业--------必会内容Alertdialong(对话框)

    Java代码

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:padding="15dp">
         
        <ImageView
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:scaleType="fitXY"
            android:background="@drawable/xiaohuli"/>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
            <TextView
                android:id="@+id/tv_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="用户你好"
                android:gravity="center"
                android:textSize="30dp"
                android:textColor="#000000"
                android:layout_marginLeft="15dp"/>
            <TextView
                android:id="@+id/tv_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dp"
                android:text="现在时间为:2000-11-5"
                android:textSize="26dp"
                />
            <TextView
                android:id="@+id/tv_wupin"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dp"
                android:gravity="center"
                android:text="请选择你喜爱的物品"
                android:textSize="26dp"
                />
             
        </LinearLayout>
     
    </LinearLayout>
    

      XML代码

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:padding="10dp"
       >
        <Button
            android:id="@+id/dialog1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="对话框常用标准"
            android:textAllCaps="false"/>
        <Button
            android:id="@+id/dialog2"
            android:layout_marginTop="20dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="列表对话框"
            android:textAllCaps="false"/>
        <Button
            android:id="@+id/dialog3"
            android:layout_marginTop="20dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="列表对话框带按钮方式"
            android:textAllCaps="false"/>
        <Button
            android:id="@+id/dialog4"
            android:layout_marginTop="20dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="多选对话框(最常用)"
            android:textAllCaps="false"/>
    </LinearLayout>
    

      

     

  • 相关阅读:
    原型模式
    单例模式-2(注册式单例)
    单例模式-1(懒汉式、饿汉式)
    PBKDF2加密的实现
    vue中获取客户端IP地址
    微信公众平台,监听用户输入及事件
    详解二叉树的遍历-前中后序遍历/层序遍历-递归/迭代
    联想小新pro关机变慢的解决办法
    MySQL自学笔记系列
    MySQL入门-首先搞清楚【数据类型】
  • 原文地址:https://www.cnblogs.com/xuwei123456/p/13972556.html
Copyright © 2011-2022 走看看