【发布时间】:2018-07-24 22:16:36
【问题描述】:
我正在制作一个待办事项应用程序。基本上,我希望屏幕从顶部的添加按钮开始。当用户单击按钮时,按钮会向下滑动,用户可以输入刚好适合一/两行的字符。用户一次只能输入 10-15 个这样的任务,按钮每次向下滑动相同的距离。我该怎么做?这是我编写的当前 xml 代码:
<ListView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintVertical_bias="0.111" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:text="Button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/list_view" />
另外,我知道 listview 属性可能已关闭。我会尝试通过谷歌搜索来修复它们,但如果你现在可以帮助我,我将不胜感激。考虑这是一个额外的问题。
【问题讨论】:
标签: android android-layout listview