Android7.0中文文档(API)-- AbsoluteLayout.LayoutParams

完整内容,请参考:http://www.zhdoc.net/android/reference/android/widget/AbsoluteLayout.LayoutParams.html

AbsoluteLayout.LayoutParams

public static class AbsoluteLayout.LayoutParams
extends ViewGroup.LayoutParams

java.lang.Object
   ↳android.view.ViewGroup.LayoutParams
    ↳android.widget.AbsoluteLayout.LayoutParams


Per-child layout information associated with AbsoluteLayout. See Absolute Layout Attributes for a list of all child view attributes that this class supports.
与AbsoluteLayout相关的每个子布局的信息。关于此类支持的所有子视图属性列表,请参考Absolute Layout Attributes

摘要


继承XML属性

From class android.view.ViewGroup.LayoutParams

继承常量

From class android.view.ViewGroup.LayoutParams

字段

public intx

The horizontal, or X, location of the child within the view group.
水平,或X,在视图组中的子项的位置。

public inty

The vertical, or Y, location of the child within the view group.
垂直,或Y,在视图组中的子项的位置。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
public partial class MainPage : ContentPage { public MainPage() { AbsoluteLayout AbsoluteLayout = new AbsoluteLayout { Margin = new Thickness(20) }; new Thread(new ThreadStart(async () => { while (true) { Application.Current.Dispatcher.Dispatch(async () => { //获取AbsoluteLayout的子元素集合 var children = AbsoluteLayout.Children; //遍历子元素集合,将每个子元素从AbsoluteLayout中移除 while (children.Count > 0) { absoluteLayout.Children.Remove(children[0]); } //创建一个Random对象用于生成随机颜色 Random random = new Random();创建一个 List<Task>用于存放旋转任务 List<Task> tasks = new List<Task>();for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { //生成一个随机颜色 Color color = Color.FromRgb(random.下一个(256),随机。下一个(256),随机。下一页(256));创建一个BoxView对象并设置颜色和圆角 BoxView boxView = new BoxView { 颜色 = 颜色, 角半径 = 10 };将BoxView对象添加到AbsoluteLayout中,并设置布局标志为None Add(AbsoluteLayout, boxView, new Rect(60 * i, 60 * j, 50, 50), AbsoluteLayoutFlags.None);把BoxView的旋转任务添加到List<Task>中 tasks.Add(boxView.RelScaleTo(1, 3000));任务。Add(boxView.RelScaleTo(-1, 3000));} } //等待所有旋转任务完成 await Task.WhenAll(tasks);});等待一秒钟 await Task.Delay(6000);} })).开始();内容 = 绝对布局;初始化组件();} public void Add(AbsoluteLayout AbsoluteLayout, IView view, Rect rect, AbsoluteLayoutFlags flags) { if (view == null) 抛出新的 ArgumentNullException(nameof(view)); absoluteLayout.Add(view); absoluteLayout.SetLayoutBounds(view, rect); absoluteLayout.SetLayoutFlags(view, flags); } }他只执行了缩小没执行放大
05-24

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值