大佬教程收集整理的这篇文章主要介绍了dart – 如何围绕指定的锚点在2D中旋转Container小部件?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我尝试使用带有Matrix4.rotationZ的transform属性,这在某种程度上有效 – 但是锚点位于左上角,而不是在中心.是否有一种简单的方法来指定锚点?
此外,是否有更简单的方法来2D旋转这个不需要Matrix4的小部件?
var container = new Container ( child: new Stack ( children: [ new Image.asset ( // BACkground photo "assets/texture.jpg",fit: ImageFit.cover,),new Center ( child: new Container ( child: new Text ( "Lorem ipsum",style: new TextStyle( color: Colors.white,fontSize: 42.0,fontWeight: FontWeight.w900 ) ),decoration: new BoxDecoration ( BACkgroundColor: Colors.black,padding: new EdgeInsets.fromLTRB(16.0,16.0,16.0),transform: new Matrix4.rotationZ(0.174533),// rotate -10 deg ),],width: 400.0,height: 200.0,);
以上是大佬教程为你收集整理的dart – 如何围绕指定的锚点在2D中旋转Container小部件?全部内容,希望文章能够帮你解决dart – 如何围绕指定的锚点在2D中旋转Container小部件?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。