如何在图像底部添加边框?

伊斯梅尔·阿尔图诺(IsmailAltunören)

我想在图像底部添加50px高的红色边框。

例如:

在此处输入图片说明

        <ImageView android:id="@+id/meme_generated_image" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:layout_gravity="center_horizontal"
            android:layout_margin="5dp" 
            android:scaleType="fitCenter" />


        <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content">

            <EditText android:id="@+id/edt_meme_bottom_txt1" android:layout_width="match_parent"
                android:layout_height="wrap_content" android:layout_margin="5dp"
                android:background="@drawable/edt_text_bg" android:ems="10"
                android:hint="Write Text" android:padding="10dp" android:singleLine="true" />
        </LinearLayout>

我的图像从Java文件加载。你能帮我么。

沙迪克·汗(Shadik Khan)

使用以下代码并将其添加到图片下方

<View android:id="@+id/view" 
            android:layout_width="match_parent"
            android:layout_height="20dp(as per your requirment)"
            android:background="your background color or boarder" />

更新在发布代码时,请在ml以下将您的xml替换为ml。

<LinearLayout 
  android:layout_width="match_parent" 
  android:layout_height="wrap_content"
  android:orientation = "vertical">

  <ImageView android:id="@+id/meme_generated_image" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:layout_gravity="center_horizontal"
            android:layout_margin="5dp" 
            android:scaleType="fitCenter" />

    <View android:id="@+id/view" 
            android:layout_width="match_parent"
            android:layout_height="20dp(as per your requirment)"
            android:background="your background color or boarder" />

  </LinearLayout>


        <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content">

            <EditText android:id="@+id/edt_meme_bottom_txt1" android:layout_width="match_parent"
                android:layout_height="wrap_content" android:layout_margin="5dp"
                android:background="@drawable/edt_text_bg" android:ems="10"
                android:hint="Write Text" android:padding="10dp" android:singleLine="true" />
        </LinearLayout>

如果要在加载图像后在图像下方显示boader,请先使视图的可见性消失,然后在图像视图中完成图像加载后,再通过Java代码使该视图可见。

希望对您有帮助。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何在边框中添加图像

来自分类Dev

如何在Word中的文本底部添加边框?

来自分类Dev

如何在边框底部重复添加图像,其中两个图像之间应该有一个空格

来自分类Dev

如何在iOS中添加表格视图的图像底部

来自分类Dev

如何在opencv python中的图像周围添加边框

来自分类Dev

如何在JavaScript中添加和删除图像上的边框

来自分类Dev

如何在图像上添加徽标(和边框)?

来自分类Dev

隐藏溢出时如何添加底部边框?

来自分类Dev

如何仅在EditText的底部添加边框?

来自分类Dev

如何在C#中向Excel范围添加底部边框?

来自分类Dev

如何在表格标题下方添加边框底部或水平线

来自分类Dev

如何在C#中向Excel范围添加底部边框?

来自分类Dev

如何在边框内制作边框底部?

来自分类Dev

如何在边框内制作边框底部?

来自分类Dev

在色带底部添加边框

来自分类Dev

如何在边框上添加边框?

来自分类Dev

如何使用css添加边框底图像

来自分类Dev

如何动态添加图像的左边框

来自分类Dev

如何向表视图节标题添加底部边框

来自分类Dev

如何创建边框底部?

来自分类Dev

如何在Django中的每个图像上添加自定义底部

来自分类Dev

如何在D3中的悬停时为图像添加边框

来自分类Dev

WPF C#如何在发生特定事件时向图像添加边框

来自分类Dev

如何在顶部和底部设置边框线性布局

来自分类Dev

如何在CSS中创建凹形底部边框?

来自分类Dev

如何在 ViewGroups 之间创建阴影底部边框?

来自分类Dev

如何在android中设置视图的边框底部

来自分类Dev

如何在每个部分制作此边框底部曲线?

来自分类Dev

如何在div的底部中心对齐图像

Related 相关文章

热门标签

归档