首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >android布局:此标签及其子标签可以替换为一个<TextView/>和一个复合可绘制

android布局:此标签及其子标签可以替换为一个<TextView/>和一个复合可绘制
EN

Stack Overflow用户
提问于 2010-07-10 00:03:36
回答 11查看 48.9K关注 0票数 122

当我在一个特定的XML文件上运行layout时,我得到这样的结果:

 This tag and its children can be replaced by one <TextView/> 
and a compound drawable

应该对以下xml代码进行哪些更改:

<LinearLayout android:id="@+id/name_layout"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:background="@drawable/grouplist_single_left_grey_area" >
                <ImageView android:id="@+id/photo_image"
                    android:layout_width="@dimen/thumbnail_width"
                    android:layout_height="@dimen/thumbnail_height"
                    android:paddingBottom="5dip"
                    android:paddingTop="5dip"
                    android:paddingRight="5dip"
                    android:paddingLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:clickable="true"
                    android:focusable="true"
                    android:scaleType="fitCenter"
                    android:src="@*android:drawable/nopicture_thumbnail"
                    android:background="@drawable/photo_highlight" />
                <TextView android:id="@+id/name"
                    android:paddingLeft="5dip"
                    android:layout_weight="1"
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:textAppearance="?android:attr/textAppearanceLarge" />
            </LinearLayout>

这是它在屏幕上的样子:

相机图标是默认图标。点击该按钮,用户可以选择另一张图片。

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

https://stackoverflow.com/questions/3214424

复制
相关文章

相似问题

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