CGContextRef currentContext = UIGraphicsGetCurrentContext();
UIGraphicsBeginImageContext(drawImage.frame.size);
[drawImage.image drawInRect:CGRectMake(0,0, drawImage.frame.size.width, drawImage.frame.size.height)];
CGContextSetRGBStrokeColor(currentContext, 0.0, 0.0, 0.0, 1.0);
UIBezierPath *path=[self pathFromPoint:currentPoint
toPoint:currentPoint];
CGContextBeginPath(currentContext);
CGContextAddPath(currentContext, path.CGPath);
CGContextDrawPath(currentContext, kCGPathFill);
drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
Run Code Online (Sandbox Code Playgroud)
在上面CGContextRef currentContext
创建的代码中UIGraphicsGetCurrentContext()
,将它传递给 CGContextBeginPath CGContextAddPath CGContextDrawPath
currentContext有参数,它对我不起作用!当我在做的时候touchMovie
.
当我直接UIGraphicsGetCurrentContext()
代替currentContext
它为我工作.我想知道为什么会那样?
@All请告诉我这个问题.
如何将自定义UIBarButtonItem添加到导航栏右侧.
public UIBarButtonItem btn_Cart {get; set;}
public DetailedController (){
string buttonTitle = "One";
btn_Cart = new UIBarButtonItem (buttonTitle, UIBarButtonItemStyle.Bordered, null);
btn_Cart.Clicked += (s, e) => { new UIAlertView ("click!", "btnOne clicked", null, "OK", null).Show ();
};
}
public override void ViewDidLoad (){
base.ViewDidLoad ();
// Added btn_Cart to RightSide Of Naviation Bar.
this.NavigationItem.SetRightBarButtonItem (btn_Cart, true);
}
Run Code Online (Sandbox Code Playgroud)
它没有添加到navigationItem.
如果我将我的代码更改为
public override void ViewDidLoad (){
this.NavigationItem.SetRightBarButtonItem(
new UIBarButtonItem(UIImage.FromBundle ("Image.png")
, UIBarButtonItemStyle.Plain
, (sender,args) => {
new UIAlertView ("click!", "btnOne clicked", null, "OK", …
Run Code Online (Sandbox Code Playgroud) 运行应用程序观察器后,[MC] Invalidating cache
控制台中将继续显示消息。
为了删除我已经添加了"Environment Variables"
添加的OS_ACTIVITY_MODE
Set的Edit Schemedisable
如何停止[MC] Invalidating cache
无OS_ACTIVITY_MODE
设定值的继续显示disable
我是一名从事iphone绘画应用的初学者.
为我的iPhone应用程序添加新工具称为喷枪...
这将喷涂在UIImageView上.任何人都可以帮助我如何使用它.
如何将字符串参数传递给EventHandler?
ViewController(A)书面事件处理程序
public event EventHandler ValueChanged;
void ResponseCompleted(object sender, CommonCode.ResponseEventArgs e){
this.InvokeOnMainThread (delegate {
if (ValueChanged != null) {
ValueChanged (this, new EventArgs (e.ResponseData));
// e.ResponseData is an String datatype.
}
});
}
Run Code Online (Sandbox Code Playgroud)
的ViewController(B)
relatedDataSource.ValueChanged += delegate {
Get Response Data from ViewControllerA
}
Run Code Online (Sandbox Code Playgroud) 使用XCTExpectFailure
并运行测试用例时 ( Cmd + U) 从“显示测试导航器”中,它显示灰色十字 (x) 其他测试用例以绿色显示。
测试用例中的灰色指示器 (x) 是什么?
需要在这里做什么吗?
例如:
@interface ClassToAddMethodsTo (category1,category2,category3)
...methods go here
@end
Run Code Online (Sandbox Code Playgroud) 如何检查在db数据库中创建表的位置.
var folder = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
SQLiteConnection db = new SQLiteConnection (System.IO.Path.Combine (folder,"note.db"));
try{
var existTable = db.Query<TransationTable>("SELECT count(*) FROM sqlite_master WHERE type = 'Table' AND name = 'TransationTable' ");
Console.WriteLine ("Count {0}",existTable.Count);
if(existTable.Count == 0){
tableview.Hidden = true;
lbl_NotFound.Hidden = false;
}
else{
tableview.Hidden = false;
lbl_NotFound.Hidden = true;
}
}
catch{
Console.WriteLine ("Calling Excpetion!");
}
}
Run Code Online (Sandbox Code Playgroud)
它总是给我数数1.
@thanks提前.
如何从uiviewcontroller对象resignFirstResponder处于活动状态.
我有五个文本域一,二,三,四,五.
- (void)removeKeyBoard{
[one resignFirstResponder];
[two resignFirstResponder];
[three resignFirstResponder];
[four resignFirstResponder];
[five resignFirstResponder];
}
Run Code Online (Sandbox Code Playgroud)
上面的代码完成了我的工作,但每个对象引用都指定了resignFirstResponder.
有没有办法,处理resignFirstResponser哪个字段是活动的,UIViewController
自动重新签名该对象.
@All先谢谢.
球队,
我有UITableView,其中有50多个细胞计数.每个细胞的宽度是60.
当我向上滚动到20个单元格时,然后点击任何单元格
它给出了索引路径值高于单元格值而不是单击单元格值
在CellForRowAtIndexPath里面
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
[[cell checkButton] addTarget:self action:@selector(checkButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
-(void)checkButtonAction:(id)sender
CGPoint touchPoint = [sender convertPoint:CGPointZero toView:self.tableview];
NSIndexPath *indexPath = [self.tableview indexPathForRowAtPoint:touchPoint];
UIButton *button = (UIButton *)sender;
}
Run Code Online (Sandbox Code Playgroud)
如果选择的索引是21给出索引20,则保持索引计数从零开始.
这个问题在iOS 10.1 iphone 7 plus设备中观察到,不在模拟器iPhone 7加iOS 10.1(14B72)中
调试值{length = 2,path = 0 - 14}
NSIndexPath路径应为0 - 15但它给出0 - 14.
objective-c uitableview didselectrowatindexpath nsindexpath ios
ios ×5
iphone ×4
objective-c ×4
c# ×3
xamarin ×3
xcode ×2
caching ×1
database ×1
eventhandler ×1
ios8 ×1
nsindexpath ×1
sqlite ×1
uitableview ×1
unit-testing ×1