首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为什么布局的背景会影响布局中EditText的背景?

为什么布局的背景会影响布局中EditText的背景?
EN

Stack Overflow用户
提问于 2012-06-19 11:17:32
回答 1查看 121关注 0票数 0

我在Linearlayout中添加了一个EditText,为每个set设置一张图片作为背景。但是Linearlayout的背景会影响EditText的背景,代码如下:

代码语言:javascript
运行
复制
<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_centerVertical="true" 
    android:layout_marginLeft="10dp" 
    android:background="@drawable/layout_bg" 
    > 

    <EditText     
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:background="@drawable/input" 
        android:inputType="text" 
        android:paddingLeft="4dp" 
        android:layout_margin="4dp" 
        /> 
    </LinearLayout>

LinearLayout会影响输入,但当我设置Linearlayout #F9F9F9的背景时,layout_bg的背景不会影响EditText的背景。为什么会发生这种情况?

我是新来的,现在不能上传图片。上面的结果是,外部背景的颜色是蓝色,但EditText的背景颜色是白色,我希望内部背景是有意义的,我应该怎么做呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-06-20 00:38:27

问题解决了,我看不到里面的背景,因为它是透明的!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11093934

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档