ykl2015 2016-03-24 06:59 采纳率: 33.3%
浏览 1918
已结题

linelayout边框如何设置!!!

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/border">

            <ImageView
                android:id="@+id/home_product_img1"
                android:layout_width="wrap_content"
                android:layout_height="125dp"
                android:layout_weight="2"
                android:gravity="center"
                android:src="@drawable/default_pic_240" />
            <TextView
                android:id="@+id/test"
                android:layout_below="@id/home_product_img1"
                android:layout_width="wrap_content"
                android:layout_height="15dp"
                android:text="进口巧克力"
                android:textColor="@color/home_blue"
                android:textSize="12sp" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/app_red"
                android:text="¥"
                android:textSize="8sp" />       

            <TextView
                android:id="@+id/test1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="3dp"
                android:text="299"
                android:textColor="@color/app_red"
                android:textSize="8sp" />

            <TextView
                android:id="@+id/test2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="30dp"
                android:text="299"
                android:textSize="8sp" />

                </LinearLayout>
        </LinearLayout>

border.xml

<?xml version="1.0" encoding="utf-8"?>

<stroke
    android:width="0.01dp"
    android:color="#CFCFCF" />

<corners android:topLeftRadius="0.05dp"   
                android:topRightRadius="0.05dp"    
            android:bottomRightRadius="0.05dp"   
            android:bottomLeftRadius="0.05dp"/>   

图片说明

左右图片的地方不显示!!!

  • 写回答

1条回答 默认 最新

  • 小小Q_Forler 2016-03-24 07:15
    关注

    HI,又见了

    给最外层的 LinarLaylout加个padding = 1属性

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算