gpt4 book ai didi

android - "How to concisely implement an editable table layout"

转载 作者:行者123 更新时间:2023-11-29 01:03:59 29 4
gpt4 key购买 nike

我是 android 的新手,我正在尝试为一个项目获取这个特定的布局,但我想知道是否有更简单的方法,我已经添加了 .xml 文件的代码以及图像我想要的布局。我也进行了一些查询搜索,但大多数最终得到的解决方案涉及到一种称为 MYSQL 的东西,对于像我这样的初学者来说,这似乎真的很吓人......

enter image description here

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.ruturaj.myapplication.MainActivity">


<EditText
android:id="@+id/editText00"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="68dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText01"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText02"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="288dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText03"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="244dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText04"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="200dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText05"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="156dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText06"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="112dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText10"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="68dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText11"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText12"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="288dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText13"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="244dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText14"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="200dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText15"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="156dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText16"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="112dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.229" />

<EditText
android:id="@+id/editText20"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="68dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.524" />

<EditText
android:id="@+id/editText21"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.524" />

<EditText
android:id="@+id/editText22"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="288dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.524" />

<EditText
android:id="@+id/editText23"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="244dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.524" />

<EditText
android:id="@+id/editText24"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="200dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.524" />

<EditText
android:id="@+id/editText25"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="156dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.524" />

<EditText
android:id="@+id/editText26"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="112dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.524" />

<EditText
android:id="@+id/editText30"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="68dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.451" />

<EditText
android:id="@+id/editText31"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.451" />

<EditText
android:id="@+id/editText32"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="288dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.451" />

<EditText
android:id="@+id/editText33"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="244dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.451" />

<EditText
android:id="@+id/editText34"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="200dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.451" />

<EditText
android:id="@+id/editText35"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="156dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.451" />

<EditText
android:id="@+id/editText36"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="112dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.451" />

<EditText
android:id="@+id/editText40"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="68dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.377" />

<EditText
android:id="@+id/editText41"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.377" />

<EditText
android:id="@+id/editText42"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="288dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.377" />

<EditText
android:id="@+id/editText43"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="244dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.377" />

<EditText
android:id="@+id/editText44"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="200dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.377" />

<EditText
android:id="@+id/editText45"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="156dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.377" />

<EditText
android:id="@+id/editText46"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="112dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.377" />

<EditText
android:id="@+id/editText50"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="68dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.303" />

<EditText
android:id="@+id/editText51"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.303" />

<EditText
android:id="@+id/editText52"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="288dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.303" />

<EditText
android:id="@+id/editText53"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="244dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.303" />

<EditText
android:id="@+id/editText54"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="200dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.303" />

<EditText
android:id="@+id/editText55"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="156dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.303" />

<EditText
android:id="@+id/editText56"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="112dp"
android:layout_marginTop="8dp"
android:background="@drawable/back"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.303" />

最佳答案

考虑将 RecyclerViewGridLayoutManager 一起使用一开始可能看起来很吓人,但比看起来容易。这个想法是创建一个 View 列表作为一个网格,并使用 Adapter 为它们提供单独的功能。

这是一个link从哪里开始。

祝你好运

关于android - "How to concisely implement an editable table layout",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48931822/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com