android - 如何在编辑文本android上创建凹面 View

标签 android android-edittext concave

我正在尝试实现下图中的 View

I tried all possible solution that I found but didn't worked for me

我尝试过的代码

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="@dimen/fab_margin">
    <com.pkmmte.view.CircularImageView
        android:layout_width="105dp"
        android:layout_height="105dp"
        android:src="@drawable/des"
        android:elevation="1dp"
        app:border="true"
        app:border_color="#864543"
        app:border_width="8dp"
        app:shadow="false"
        android:id="@+id/view" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="110dp"
        android:background="#435467"
        android:layout_alignBottom="@+id/view"
        android:layout_alignParentStart="true"
        android:layout_marginStart="50dp"
        android:foregroundGravity="center"
        android:layout_marginEnd="@dimen/fab_margin"/>

</RelativeLayout>

我尝试了下面的链接,并尝试根据我的观点来操作它,但没有成功

How to create EditText with rounded corners?

enter image description here

Is I am on right way? This cant be achieved by making a XML in drwable and use it as background??

最佳答案

使 TextView 低于 ImageView。

 <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="105dp"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <com.pkmmte.view.CircularImageView
        android:layout_width="105dp"
        android:layout_height="105dp"
        android:src="@drawable/des"
        android:elevation="1dp"
        app:border="true"
        app:border_color="#864543"
        app:border_width="8dp"
        app:shadow="false"
        android:id="@+id/view" />

    <TextView
        android:layout_centerVertical="true"
        android:text="111"
        android:textColor="#000000"
        android:paddingLeft="55dp"
        android:gravity="left|center_vertical"
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:layout_marginStart="50dp"
        android:background="#FFFFFF"/>
</RelativeLayout>

关于android - 如何在编辑文本android上创建凹面 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34694039/

相关文章:

android - 桌面版欧雅SDK

android - "EditText and TextView"在 android 中用千位分隔符 (,) 格式化

outline - 给定非凸多边形中的大量顶点,我如何找到边?

polygon - 查找多边形内的点

javascript - 如何使用 Google Maps JavaScript API v3 加载 map

c# - 如何使用字符串 JSON 响应压缩 ASMX 数据(C# Web 服务)

Android:防止谷歌地图在 EditText 输入后调整/移动

android - 部分不可编辑的多行编辑文本,例如填空

3d - 无退化边缘的凹多边形线裁剪

android - 信标的广告率是否会影响检测器应用程序的电池