android– 如何创建3个同样宽的TextView,它在屏幕上填充父级

android– 如何创建3个同样宽的TextView,它在屏幕上填充父级,第1张

概述HI,你能否告诉我如何在屏幕上创建3个同样宽的TextView来填充父级?我尝试这样做,但TextView的宽度是不同的:它是149,89,89.<TableLayoutxmlns:android="http://schemas.android.com/apkes/android"android:layout_width="fill_parent"android:layout_height="wrap_conten

HI,

你能否告诉我如何在屏幕上创建3个同样宽的TextVIEw来填充父级?我尝试这样做,但TextVIEw的宽度是不同的:它是149,89,89.

<tableLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"     androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content"     androID:stretchColumns="*"     androID:shrinkColumns="*">
<TextVIEw androID:ID="@+ID/t1"      androID:layout_wIDth="wrap_content"      androID:layout_height="wrap_content"      androID:layout_column="0"/><TextVIEw androID:ID="@+ID/t2"      androID:layout_wIDth="wrap_content"      androID:layout_height="wrap_content"      androID:layout_column="1"/><TextVIEw androID:ID="@+ID/t3"      androID:layout_wIDth="wrap_content"      androID:layout_height="wrap_content"      androID:layout_column="2"/>

解决方法:

<linearLayout    androID:layout_wIDth="fill_parent"     androID:layout_height="wrap_content"    >    <TextVIEw        androID:layout_height="wrap_content"        androID:layout_wIDth="0dp"        androID:layout_weight="1"    />    <TextVIEw        androID:layout_height="wrap_content"        androID:layout_wIDth="0dp"        androID:layout_weight="1"    />    <TextVIEw        androID:layout_height="wrap_content"        androID:layout_wIDth="0dp"        androID:layout_weight="1"    /></linearLayout>

总结

以上是内存溢出为你收集整理的android – 如何创建3个同样宽的TextView,它在屏幕上填充父级全部内容,希望文章能够帮你解决android – 如何创建3个同样宽的TextView,它在屏幕上填充父级所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1112559.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存