当前位置: 代码迷 >> Android >> Android Layout布局上的图片怎么突破背景图
  详细解决方案

Android Layout布局上的图片怎么突破背景图

热度:63   发布时间:2016-04-28 07:58:34.0
Android Layout布局上的图片如何突破背景图
本帖最后由 venlentine 于 2013-09-17 21:18:01 编辑
要实现的效果

已经实现的效果


代码如下,图标图片突破不出背景图啊,请问如何实现
<FrameLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/list_company_item"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/bg_company_item"
        android:layout_margin="30dp">
    <TableLayout
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:layout_gravity="center_vertical">
        <TableRow>
            <ImageView
                android:src="@drawable/icon_item"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                />
        </TableRow>
    </TableLayout>
</FrameLayout>
布局 layout android

------解决方案--------------------
android:layout_maginleft = "-xxx"
------解决方案--------------------
android:layout_maginleft ="-20dp"
但是需要看你具体的情况而且需要在线性布局中效果最好
------解决方案--------------------
在editText代码中加入
android:drawableLeft="@drawable/ic"
""里是你要加入的图片
------解决方案--------------------
android:layout_maginleft = "-20dp"
-20是代表向左移肯定会有问题的啊,
改为
android:layout_maginleft = "20dp"应该就可以了,LZ试一下吧
  相关解决方案