如何设置化合物的高度和宽度 drawable textview 在 xml?

我没有看到用于设置宽度的任何标记

在这里我安装了高度 textview, 如果我设置宽度,它将无法正常工作。


<textview android:drawableleft="@drawable/ic_launcher" android:height="50dp" android:id="@+id/nome" android:layout_height="wrap_content" android:layout_width="wrap_content" android:textcolor="#FFFFFF"></textview>


我如何安装它 xml? 是否有可能?
已邀请:

裸奔

赞同来自:

你可以尝试这样的东西:


xml version="1.0" encoding="utf-8"?
<relativelayout android:layout_height="match_parent" android:layout_width="match_parent" xmlns:android="[url=http://schemas.android.com/apk/res/android"]http://schemas.android.com/apk/res/android"[/url] xmlns:tools="[url=http://schemas.android.com/tools">]http://schemas.android.com/tools">[/url]
<textview android:gravity="center" android:id="@+id/Home" android:layout_centerhorizontal="true" android:layout_height="50dp" android:layout_width="wrap_content" android:text="Something" android:textcolor="#FFFFFF"></textview>
<imageview android:layout_height="50dp" android:layout_toleftof="@id/Home" android:layout_width="50dp" android:src="@drawable/icon"></imageview>
</relativelayout>


所以我认为你将更多地控制你的形象。 我希望它会有所帮助。

风见雨下

赞同来自:

尝试设置值
android:width="50dip"

看看你得到了什么。 浸入是独立于硬件的像素。 你必须能够看到 eclipse 在构造函数模式下。 你不能只设置价值 "300"

要回复问题请先登录注册