V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
herozem
V2EX  ›  问与答

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

  •  
  •   herozem · 2015-06-09 21:29:33 +08:00 · 1618 次点击
    这是一个创建于 3215 天前的主题,其中的信息可能已经有所发展或是发生改变。

    上次我发了 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"
    />
    
    4 条回复    2015-12-29 18:55:01 +08:00
    zts1993
        1
    zts1993  
       2015-06-09 22:14:04 +08:00
    ini2xml ?
    herozem
        2
    herozem  
    OP
       2015-06-09 22:33:31 +08:00
    @zts1993 嗯, 是把ini转xml的~
    zhgg0
        3
    zhgg0  
       2015-12-24 20:46:56 +08:00
    不明白为什么要这么干, ide 不是打一两个字母就自动补全了吗?
    这样还需要记缩略词,岂不更烦?
    herozem
        4
    herozem  
    OP
       2015-12-29 18:55:01 +08:00
    @zhgg0 那时候我在学 android ,笔记本上没装 ide , so~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1296 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 23:30 · PVG 07:30 · LAX 16:30 · JFK 19:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.