gpt4 book ai didi

c# - 继承/设置 RadioGroup 的 BackgroundView 生成的 DialogViewController TableView (MonoTouch.Dialog)

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:08:58 24 4
gpt4 key购买 nike

我想使用 MonoTouch.Dialog RadioElements 来选择数据,它必须有一个用于 TableView BackgroundViews 的 UIImageView。

我可以在初始 DialogViewController 的 TableView 上设置 BackgroundView,所以没问题,但是为每个 RadioGroup 生成的 TableView 具有默认的灰色背景图像,我似乎无法找到一种方法将它们更改为相同的背景样式初始的 TableView。

是否可以更改生成的 TableView 的 BackgroundView(为每个 RadioGroup 生成的 TableView)而无需去修改 MonoTouch.Dialog 源代码?

提前致谢。

最佳答案

据我所知,您需要创建自己的元素。但消息是这很容易做到,例如:

public class TransparentRootElement : RootElement {

// add required .ctors

public override UITableViewCell GetCell (UITableView tv)
{
var cell = base.GetCell (tv);
cell.BackgroundColor = UIColor.Clear;
return cell;
}
}

然后您只需在创建 RadioGroup 的地方使用这个新的 TransparentRootElement 类型。

关于c# - 继承/设置 RadioGroup 的 BackgroundView 生成的 DialogViewController TableView (MonoTouch.Dialog),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7897438/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com