herozem
V2EX  ›  问与答

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

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