【发布时间】:2019-04-01 02:03:52
【问题描述】:
我有这样的 XML 文件
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<linearlayout layout_height="match_parent" layout_width="match_parent" orientation="vertical">
<textview layout_height="wrap_content" layout_width="match_parent" text="Hello XML!"/>
<button layout_height="wrap_content" layout_width="wrap_content" text="Click Me"/>
</linearlayout>
我希望元素的每个属性都像这样在自己的行上
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<linearlayout
layout_height="match_parent"
layout_width="match_parent"
orientation="vertical">
<textview
layout_height="wrap_content"
layout_width="match_parent"
text="Hello XML!"/>
<button
layout_height="wrap_content"
layout_width="wrap_content"
text="Click Me"/>
</linearlayout>
如何使用 java 做到这一点?
【问题讨论】:
-
您希望每个属性都在自己的行上吗?
-
@aka-one 是的,每个属性都在它自己的行上