[英]How to draw a simple line without using Interface Builder in iphone sdk?
我想在視圖控制器中繪制一個簡單的行,而不使用“接口”構建器。
如果您只想繪制水平或垂直線,則可以使用UIView。
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(<startingX>, <startingY>, <width>, <height>)];
lineView.backgroundColor = <desiredColor>;
//assume self is UIViewController or its sublcass
[self.view addSubview:lineView];
[lineView release];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.