吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2658|回复: 7
收起左侧

[其他转载] xml布局转代码工具

[复制链接]
dadashuai 发表于 2021-8-6 11:12
本帖最后由 dadashuai 于 2021-8-6 11:17 编辑

将安卓的xml布局转换为各种代码,方便学习使用
示例xml布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:gravity="center"
    android:layout_height="match_parent">

    <TextView
        android:id="@+id/text_info"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="18sp"
        android:gravity="center"
        android:text="xml转代码\nhttps://github.com/fengdeyingzi/XmlToCode"
        android:autoLink="web"
        android:padding="32dp"
        />
    <TextView
        android:id="@+id/text_author"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="16sp"
        android:text="风的影子 制作"
        />

</LinearLayout>

转换为findViewById代码

image-tofindviewbyid

转换为java

image-tojava

转换为Flutter

image-toflutter

转换为swift

image-toswift


源码:[https://github.com/fengdeyingzi/XmlToCode]

XmlToCode.jar.zip

76.46 KB, 下载次数: 46, 下载积分: 吾爱币 -1 CB

jar文件,使用jdk1.8或以上版本运行

免费评分

参与人数 2吾爱币 +2 热心值 +1 收起 理由
无相孤君 + 1 鼓励转贴优秀软件安全工具和文档!
cjcmxc + 1 + 1 我很赞同!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

无相孤君 发表于 2021-8-19 12:54
我来了,大佬
Alsser 发表于 2021-11-1 12:09
zhangyyue 发表于 2021-11-2 13:01
无相孤君 发表于 2021-11-10 12:21
影子啊!我最近看到了新的文章。
为什么不先把控件addView父布局,然后在getLayoutParams。
然后setLayoutParams。
game168 发表于 2021-11-12 14:08
非常感谢,正好需要。
 楼主| dadashuai 发表于 2021-11-17 08:33
无相孤君 发表于 2021-11-10 12:21
影子啊!我最近看到了新的文章。
为什么不先把控件addView父布局,然后在getLayoutParams。
然后setLayou ...

有道理诶
DYCY 发表于 2022-4-2 09:42
这个布局转换代码很实用
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-9 12:56

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表