基本上我想要的东西: –
而不是像这样的东西
布局文件将是
<linearLayout androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:orIEntation="horizontal" > <ImageVIEw /> <TextVIEw /></linearLayout>解决方法 是的,您可以在相对于TextVIEw的高度缩小ImageVIEw.要匹配TextVIEw的高度,请将match_parent设置为ImageVIEw的androID:layout_height,这将有助于ImageVIEw获取TextVIEw的高度.尝试如下……
<linearLayout androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:orIEntation="horizontal" > <ImageVIEw androID:layout_wIDth="wrap_content" androID:layout_height="match_parent" androID:src="@drawable/ic_launcher" /> <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="TextVIEw" androID:textSize="30sp" /></linearLayout>
您也可以通过以下方式获得相同的结果……
<TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:drawableleft="@drawable/ic_launcher" androID:text="TextVIEw" androID:gravity="center_vertical" androID:textSize="30sp" />总结
以上是内存溢出为你收集整理的android – 将ImageView缩放为XML格式的TextView全部内容,希望文章能够帮你解决android – 将ImageView缩放为XML格式的TextView所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)