在Android中编辑聊天应用程序的文本设计

问题描述

我需要像这样设计编辑文本

enter image description here

是否使用图像视图创建了附件文件图标和其他图标? 还是有一个库可以像这样编辑文本?

解决方法

您可以使用imageview显示它们,但是通常使用ImageButtons。 我认为没有用于此简单任务的库。 以xml为例:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:background="#00CCCC"
    >
    <RelativeLayout
        android:background="@drawable/bottombar"
        android:layout_alignParentBottom="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp">
        <ImageButton
            android:id="@+id/buttonLeft"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:background="@drawable/buttonlayout">
        </ImageButton>
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="40dp"
            android:hint="Type here!">
        </EditText>
        <ImageButton
            android:id="@+id/b1"
            android:layout_alignParentRight="true"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:background="@drawable/buttonlayout">
        </ImageButton>
        <ImageButton
            android:id="@+id/b2"
            android:layout_toLeftOf="@id/b1"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:background="@drawable/buttonlayout">
        </ImageButton>
        <ImageButton
            android:layout_toLeftOf="@id/b2"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:background="@drawable/buttonlayout">
        </ImageButton>
    </RelativeLayout>

</RelativeLayout>

这看起来像这样:Fermat's little theorem

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...