• 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>
    

      

     

  • 相关阅读:
    循环调用spring的dao,数个过后无响应
    WebEx如何录制电脑内的声音
    java对象转换String类型的三种方法
    使用Hibernate+MySql+native SQL的BUG,以及解决办法
    mysql之触发器trigger
    mysql 触发器学习
    Java对比两个数据库中的表和字段,写个冷门的东西
    PHP几个快速读取大文件例子
    Java安全中的“大坑”,跨平台真“浮云”
    国内一些大公司的开源项目
  • 原文地址:https://www.cnblogs.com/xuwei123456/p/13972556.html
Copyright © 2020-2023  润新知