在iOS中绘制矩形 [英] Drawing Rectangles in iOS
问题描述
我的应用程序的目标是让用户能够通过在iPhone屏幕的左侧和右侧滑动来对不同的计划选项进行排序。当用户对这些不同的调度选项进行排序时,如何绘制和删除矩形?
My goal for my app is for the user to be able to sort through different scheduling options by swiping to the left and right of an iPhone screen. How would I draw and remove rectangles as the user sorts through these different scheduling options?
我有一个UIViewController.h,UIViewController.m和UIViewController.xib文件来操作。我需要一个单独的UIView类吗?如果是这样,我如何将该UIView类连接到我的.xib文件中的视图?
I have a UIViewController.h, UIViewController.m, and UIViewController.xib files to manipulate. Do I need a separate UIView class? If so, how do I connect that UIView class to the view in my .xib file?
推荐答案
哇...太多了复杂的解决方案,这就是你需要的:
Wow... so many complicated solution, here is what you need:
UIView *myBox = [[UIView alloc] initWithFrame:CGRectMake(180, 35, 10, 10)];
myBox.backgroundColor = [UIColor lightGrayColor];
[self.view addSubview:myBox];
没有别的......不需要为实施而疯狂。
Nothing else... don't need to go crazy on the implementation.
这篇关于在iOS中绘制矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!