0基础用android做一个excel表查询器(1)编写页面

0基础用android做一个简易excel表查询器(1)编写页面

excel题库查询器,支持xlsx和xls

第一次写博客啊,可能写的不好。
由于疫情最近在家,就想着学习一下android,做了几个小软件,由于开始没有java基础,刚开始还是有点难受的,但做完之后感觉自己的java也开始入门了。之后我会把我写的几个小软件都分享出来。
首先,就是android的安装,可以看这个博客https://blog.csdn.net/qq_41976613/article/details/91432304
写的很详细,android的安装耗费了我好多时间,我是在刷网课时候装的,正好,哈哈
如果安装顺利的话应该可以看到这样一个页面
在这里插入图片描述

左边的palette中有很多控件,因为做的是一个excel的查询器,肯定得有查询的内容和结果,所以选取TestView和Plain Text,其中TestView就可以用来显示你查找的结果,而Plain Text则用来输入你所需要查找的内容。剩下的Text则是TestView的不同形式,如Password就是显示的text用*号表示,可以都去试一下,这里由于我所查找的Excel可能显示的内容比较多,所以用的是MultiAutoCompleteTextView,你可以把它理解为有滚动条的TestView,这样就不会担心内容过多的问题。
最后因为是查找,还要放一个Buttons
在这里插入图片描述

放的过程中当然以美观为主,因为这个程序功能比较单一,所以我就只放了三个控件。
在这里插入图片描述
但要做好约束,这是具体的控件代码

<Button
    android:id="@+id/tv_search"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="307dp"
    android:layout_marginTop="8dp"

    android:layout_marginEnd="16dp"
    android:onClick="search"
    android:text="查找"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/tv_text" />

<EditText
    android:id="@+id/tv_text"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="36dp"

    android:ems="10"
    android:inputType="textPersonName"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.003"
    tools:layout_editor_absoluteX="0dp" />

<MultiAutoCompleteTextView
    android:id="@+id/tv_answer1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="76dp"
    app:layout_constraintTop_toBottomOf="@+id/tv_text"
    tools:layout_editor_absoluteX="16dp" />

其中Button项android:onClick属性后面写上对应你想触发的函数,我这里命名为serarch。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值