当前位置:网站首页>直播app开发搭建,flutter 实现自适应、自动换行、相对布局

直播app开发搭建,flutter 实现自适应、自动换行、相对布局

2022-08-09 22:29:00 云豹网络科技

直播app开发搭建,flutter 实现自适应、自动换行、相对布局
Android实现:

<LinearLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">
 
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="文本1内容很长" />
 
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="文本2紧靠右侧" />
</LinearLayout>

flutter实现代码:

Row(
      children: [Flexible(child: Text("内容很长")), Text("[紧靠右侧]")],
    )

接下来内容:

 
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
      IntrinsicWidth(
          child:
              Row(children: [Expanded(child: Text("文本1内容很长内容")), Text("文本2紧靠右侧")]))
    ])

以上就是直播app开发搭建,flutter 实现自适应、自动换行、相对布局, 更多内容欢迎关注之后的文章

原网站

版权声明
本文为[云豹网络科技]所创,转载请带上原文链接,感谢
https://yunbaozhibo.blog.csdn.net/article/details/126246731