我知道没有可用的公共API,但我想知道是否在Monotouch中内部实现了任何改进.
否则,在浅色背景上使用UIPageControl的推荐方法是什么?
解决方法 我翻译了这个.我不确定它会起作用,但它确实可以编译.请注意,链接到的页面包含注释,表明Apple对此代码不满意并可能拒绝它:using System;using Monotouch.Foundation;using Monotouch.UIKit;namespace Whatever{ public class StyledPageControl : UIPageControl { public StyledPageControl () : base() { } public overrIDe int CurrentPage { get { return base.CurrentPage; } set { base.CurrentPage = value; string imgActive = NSBundle.MainBundle.PathForResource("activeImage","png"); string imgInactive = NSBundle.MainBundle.PathForResource("inactiveImage","png"); for (int subvIEwIndex = 0; subvIEwIndex < this.SubvIEws.Length; subvIEwIndex++) { UIImageVIEw subvIEw = this.SubvIEws[subvIEwIndex] as UIImageVIEw; if (subvIEwIndex == value) subvIEw.Image = UIImage.Fromfile(imgActive); else subvIEw.Image = UIImage.Fromfile(imgInactive); } } } public overrIDe int Pages { get { return base.Pages; } set { base.Pages = value; string img = NSBundle.MainBundle.PathForResource("inactiveImage","png"); for (int subvIEwIndex = 0; subvIEwIndex < this.SubvIEws.Length; subvIEwIndex++) { UIImageVIEw subvIEw = this.SubvIEws[subvIEwIndex] as UIImageVIEw; subvIEw.Image = UIImage.Fromfile(img); } } } }}总结
以上是内存溢出为你收集整理的ios – 在MonoTouch中更改UIPageControl点的颜色全部内容,希望文章能够帮你解决ios – 在MonoTouch中更改UIPageControl点的颜色所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)