登录界面的重用

很多代码一遍又一遍的复制黏贴,有什么好方法?

先把登录界面的布局代码贴上。

 <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_marginTop="50sp"
        android:padding="30dp">

        <TextView

            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="XXXXXXXX"
            android:textSize="40sp"
            android:drawableLeft="@mipmap/ic_launcher"
            android:layout_marginLeft="20dp"/>

        <EditText
            android:layout_marginTop="30dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="账号/手机号码"/>

        <EditText
            android:layout_marginTop="10dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="密码"/>

        <Button
            android:layout_marginTop="10dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="登录"
            android:textSize="20sp"/>
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:layout_marginTop="10dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="忘记密码?"
                android:textColor="#00aaff"
                android:textSize="16sp"/>
            <TextView
                android:layout_marginTop="10dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="新用户注册"
                android:textColor="#00aaff"
                android:textSize="16sp"
                android:layout_alignParentRight="true"/>

        </RelativeLayout>

    </LinearLayout>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:textSize="20dp"
        android:text="杭州如东科技有限公司Copyright@2021"
        android:textColor="#222222"/>


</RelativeLayout>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
LabVIEW 是国际上常用的虚拟仪器平台,以其图形化编程界面而闻名。在 LabVIEW 中,界面重用是一种重要的特性,它可以提高程序开发的效率。 首先,LabVIEW 中的界面重用能够实现模块化开发。LabVIEW程序可以由多个 VI(虚拟仪器)组成,每个 VI 起到不同的功能。通过将这些 VI 进行界面重用,我们可以将其作为子VI 嵌入到其他主程序中,从而实现对功能模块的复用。这样,当需要在其他程序中使用相同功能的时候,只需要将子VI 添加进来,而无需重新编写整个功能模块,大大提高了开发效率。 其次,界面重用可以实现界面设计的统一性。在 LabVIEW 中,可以将界面设计为 VI 或自定义控件存储为组件文件,以后可以在其他程序中很方便地调用。这样,设计相同的界面样式只需要一次,就可以在多个程序中重复使用。这不仅节省了设计时间,而且保持了界面的一致性。 此外,LabVIEW 还提供了组件级扩展功能,如连接器面板和属性面板。连接器面板允许用户创建自定义输入和输出端口,以使 VI 更具通用性。而属性面板则允许用户通过属性节点来编辑子VI 的属性。这些扩展功能与界面重用相结合,可进一步提高程序的灵活性和可扩展性。 总而言之,LabVIEW 的界面重用功能能够实现模块化开发、提高界面设计的一致性,并且通过扩展功能可以使界面更加灵活和可扩展。这些特性有效地提高了 LabVIEW 程序开发的效率和质量。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值