游戏王中国 2022-03-24 18:55 采纳率: 53.3%
浏览 60
已结题

xamarin android GridLayout1 动态添加控件设置控件距离边距布局问题

问题遇到的现象和发生背景

GridLayout1 动态添加控件设置距离边距布局问题

问题相关代码,请勿粘贴截图
        GridLayout1 = FindViewById<GridLayout>(Resource.Id.gridLayout1);
        GridLayout1.ColumnCount = 7;
        Button tv1 = new Button(this);
        tv1.Text = "数量";
        GridLayout1.AddView(tv1);
        Button tv2 = new Button(this);
        tv2.Text = "商品名";
        GridLayout1.AddView(tv2);
        Button tv3 = new Button(this);
        tv3.Text = "重量";
        GridLayout1.AddView(tv3);
        Button tv4 = new Button(this);
        tv4.Text = "单价";
运行结果及报错内容
我的解答思路和尝试过的方法

img

我想要达到的结果

如何动态设置控件位置边距

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 4月1日
    • 创建了问题 3月24日