dart - 如何使用 anchor 布局

标签 dart rikulo

我正在努力掌握Anchor布局的用法。我有以下代码构造函数:

LokationView()
{


  buildCityUi();
  buildRegionUi();



}

buildCityUi()
{
  cityLbl = new TextView( 'City' );
  addChild( cityLbl );

  cityTxBx = new TextBox( null, 'text' )
  ..profile.width = 'flex '
  ..profile.anchorView = cityLbl
  ..profile.location = 'east center'
  ..on.layout.listen( (_) 
    {
      cityTxBx.width = 200;
      cityTxBx.requestLayout();  
    });


  addChild(cityTxBx );

}

buildRegionUi()
{

  regionLbl = new TextView( 'Region' )
  ..profile.anchorView = cityLbl
  ..profile.location = 'south start';    
  addChild( regionLbl );

  regionTxBx = new TextBox( null, 'text' )
  ..profile.width = 'flex 1'
  ..profile.anchorView = regionLbl
  ..profile.location = 'east center';
  addChild( regionTxBx );
}

我正在尝试完成以下任务:
1.使用相应的TexTBox View 创建标签 View 。
2.获取TextBox View 以占据浏览器空间的其余部分,这些 View 随浏览器宽度的变化而变化。

谢谢

最佳答案

AnchorLayout不是答案。相反,LinearLayout应该会有所帮助。

关于dart - 如何使用 anchor 布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16319186/

相关文章:

Dart — onclick 操作添加/删除类

modal-dialog - Bootjack Modal生成异常:类 'TransitionEvent'没有实例getter 'relatedTarget'

liferay - 我可以在HTML页面的一部分和Portal中使用Rikulo吗?

flutter - 如何使 flutter 标签栏展开?

flutter - 在 Dart 中如何在一个列表中添加多个列表?

dart - 跳转到 PageView() 中的另一个页面不起作用

dart - 那2个点是什么意思? 1和2有什么区别?

dart - 如何使用 Rikulo 流从客户端向服务器发送数据

ajax - 如何访问从浏览器发送到 Rikulo Steam 服务器的 POST 数据