herozem
V2EX  ›  问与答

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

  •  
  •   herozem · Jun 9, 2015 · 2524 views
    This topic created in 4183 days ago, the information mentioned may be changed or developed.

    上次我发了 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 replies  •  2015-12-29 18:55:01 +08:00
    zts1993
    zts1993
    Jun 9, 2015
    1
    ini2xml ?
    herozem
    herozem
    OP
    Jun 9, 2015
    2
    @zts1993 嗯, 是把ini转xml的~
    zhgg0
    zhgg0
    Dec 24, 2015
    3
    不明白为什么要这么干, ide 不是打一两个字母就自动补全了吗?
    这样还需要记缩略词,岂不更烦?
    herozem
    herozem
    OP
    Dec 29, 2015
    4
    @zhgg0 那时候我在学 android ,笔记本上没装 ide , so~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1841 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 10:40 · PVG 18:40 · LAX 02:40 · JFK 05:40
    ♥ Do have faith in what you're doing.