gpt4 book ai didi

android - Android 中带关闭按钮的 TextView

转载 作者:行者123 更新时间:2023-11-30 04:34:58 24 4
gpt4 key购买 nike

我可以添加一个带有关闭按钮的 TextView 吗?

假设我已经为用户提供了从屏幕上删除一些文本的选项。

如:

WASIF[x] Azhar[x] Kirmani[x] 是否有任何我可以用于此功能的 UI 组件

最佳答案

您可以使用相对布局,像这样将 Button 放在 TextView 上。

<?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">
<EditText android:id="@+id/greatTextView" android:text="Sample text"
android:layout_width="fill_parent" android:layout_height="fill_parent" />
<Button android:id="@+id/superButton" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="X"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"/>
</RelativeLayout>

关于android - Android 中带关闭按钮的 TextView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7017860/

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