在活动中准确放置文本

发布于 2025-01-06 13:11:54 字数 209 浏览 3 评论 0原文

作为我被要求编写的 Android 应用程序的一部分,有一个“联系我们”活动。此活动应该在顶部有公司徽标,然后在左侧显示各种联系点(应付账款、人力资源等)(每“行”一个),相应的号码在右侧对齐。

我花了相当多的时间尝试使用不同的布局并将它们放入 XML 中,但它看起来很糟糕。

什么方法最适合解决这个问题?它需要在手机和平​​板电脑上看起来合理。

TIA

As part of the android app I've been asked to write, there is a 'contact us' activity. This activity is supposed to have the company logo at the top, then various contact points (accounts payable, HR, etc) on the left (one on each 'line') with the corresponding number aligned on the right.

I've spent quite a few hours on attempting to use different layouts and placing them in the XML but it looks terrible.

What approach is best to solve this? It needs to look reasonable on both phones and tablets.

TIA

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

婴鹅 2025-01-13 13:11:54

请参阅表格布局。从您描述问题的方式来看,Table Layout 似乎是一个合适的解决方案。您甚至可以以相对布局为基础来设计布局。但是,您可能必须使用 android:layout_alignParentLeft="true"android:layout_alignParentRight="true" 等属性。

See Table Layout. From the way you're describing your problem, Table Layout seems to be an apt solution. You can even design your layout with Relative Layout as the base. However, you might have to use attributes such as android:layout_alignParentLeft="true", android:layout_alignParentRight="true" and others.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文