gpt4 book ai didi

android - 带按钮的文本编辑器?

转载 作者:行者123 更新时间:2023-11-30 04:51:43 25 4
gpt4 key购买 nike

我想创建一个如下所示的 EditText 和按钮:

http://www.geting.se/image.php/249016-Untitled-3.jpg/full http://www.geting.se/image.php/249016-Untitled-3.jpg/full

这与 quicksearch 几乎相同,但它是定制的,有人可以帮帮我吗?

最佳答案

您应该能够将一个 EditText 和一个按钮布局为彼此相邻,并且它们之间的填充为 0:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText android:paddingRight="0dp"
android:layout_width="wrap_content"
android:layout_height="fill_parent"/>
<Button android:paddingLeft="0dp"
android:layout_width="wrap_content"
android:layout_height="fill_parent"/>
</LinearLayout>

要在外侧而不是内侧获得弯曲的角,您可能需要为 EditText 和 Button 定义新样式。参见 applying styles and themes.

通常,您需要使用 9-patch 创建背景图像,以获得具有适当缩放比例的弯曲角。参见 Draw 9-patch

关于android - 带按钮的文本编辑器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3087771/

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