问题描述
我需要像这样设计编辑文本
是否使用图像视图创建了附件文件图标和其他图标? 还是有一个库可以像这样编辑文本?
解决方法
您可以使用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