根据缩略词生成安卓 layout.xml

2015 年 6 月 9 日
 herozem

上次我发了 http://v2ex.com/t/191168 然后最近我自己用python3写了一个根据windows ini配置文件生成layout.xml的脚本, 地址在这里

欢迎大家试用, 不过程序尚不完善, 目前只支持Button TextView EditText LinearLayout
四种, 我会陆续添加新的widget和布局方式进去, 同时也欢迎大家一起完善程序:smile:

对了, 至于说明文档, 我英文渣, 求轻喷。

示例:

[Linear2]
ori = vt
wi = wc
[Button1]
id = btn1
te = Start
wi = wc
[Button2]
id = btn2
te = Stop
wi = wc

会生成:

<Linear
    android:orientation="vertical"
    android:layout_width="wrap_content"
/>
we have not match that
<Button
    android:id="@+id/btn1"
    android:text="Start"
    android:layout_width="wrap_content"
/>
<Button
    android:id="@+id/btn2"
    android:text="Stop"
    android:layout_width="wrap_content"
/>
2343 次点击
所在节点    问与答
4 条回复
zts1993
2015 年 6 月 9 日
ini2xml ?
herozem
2015 年 6 月 9 日
@zts1993 嗯, 是把ini转xml的~
zhgg0
2015 年 12 月 24 日
不明白为什么要这么干, ide 不是打一两个字母就自动补全了吗?
这样还需要记缩略词,岂不更烦?
herozem
2015 年 12 月 29 日
@zhgg0 那时候我在学 android ,笔记本上没装 ide , so~

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/197327

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX