Skip to content

对于扩展的xml格式在Android xml应用场景中的疑问 #2047

@Mr-Czt

Description

@Mr-Czt

XML format question

kcl-lang/cli#295

Thanks for help, 我pick了你PR中的修改,在测试Android xml文件的时候遇到一点困难,UI的xml中,存在属性和子元素的区别,比如:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
	<TextView
            android:id="@+id/userNameTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="用户名"
            android:textSize="16sp"
            android:textStyle="bold" />
</LinearLayout>

or

<font color='red'>
    "Red"
</font>

对于这种样式,我现在想到的办法是利用装饰器如@info去标识是否按属性输出,感觉不太优雅,对此,您有更好的方式指导一下吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions