在活动中准确放置文本
作为我被要求编写的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅表格布局。从您描述问题的方式来看,
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 asandroid:layout_alignParentLeft="true"
,android:layout_alignParentRight="true"
and others.