0
A
回答
0
可以通過先獲取觸摸點,像這樣做自己:
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *aTouch = [touches anyObject];
CGPoint point = [aTouch locationInView:self];
CGFloat xPos = point.x;
CGFloat yPos = point.y;
}
然後利用這些信息並做出帶有x和y作爲參數的方法。並以編程方式創建一個UITextField。
UITextField * textFieldRounded = [[UITextField alloc] initWithFrame:CGRectMake(inParameterX, inParameterY, 300, 50)];
textFieldRounded.textColor = [UIColor blackColor];
textFieldRounded.font = [UIFont systemFontOfSize:17.0];
textFieldRounded.backgroundColor = [UIColor clearColor];
textFieldRounded.autocorrectionType = UITextAutocorrectionTypeNo;
textFieldRounded.keyboardType = UIKeyboardTypeDefault;
textFieldRounded.returnKeyType = UIReturnKeyDone;
textFieldRounded.clearButtonMode = UITextFieldViewModeWhileEditing;
然後將其添加到您的視圖:
[self.view addSubview:textFieldRounded];
根據您要與文本字段做什麼,你可以做一個對象來代替。也許保存到一個數組。那麼你明白了。
相關問題
- 1. 在圖像上書寫3維文字
- 2. 在Google地圖上繪製文字
- 3. 在圖像右上角繪製文字
- 4. 在位圖圖像上繪製文本
- 5. 如何繪製圖像上的文字
- 6. 在圖像上寫文字
- 7. 在圖像上寫文字
- 8. 在圖像上寫文字
- 9. 從圖像上延伸出的圖像上的文字繪製
- 10. 在繪圖區域上繪製圖像
- 11. 如何在achartengine上繪製,書寫或簡單地使用Canvas?
- 12. 如何在圖像上繪製圖像?
- 13. 在圖像上書寫文字,並將文字圖像保存在SD卡中,而無需在屏幕上繪製文字
- 14. Openlayers - 在地圖上繪製字符串
- 15. 在ConduitM上繪製地圖?
- 16. 在圖像上繪製
- 17. 在win32上繪製圖像?
- 18. 在圖像上繪製點
- 19. Android - 在圖像上繪製
- 20. 在JButton上繪製圖像?
- 21. 在地圖上繪製帶有圖像的圓形圖
- 22. 在jpg圖像上繪製文本android
- 23. 如何在圖像上下文中繪製圖像和文本?
- 24. 繪製圖像或繪製實心圓?
- 25. 在圖像上書寫文字(指定寬度)
- 26. 如何使用Windows Phone代碼在圖像上書寫文字?
- 27. 在地圖上繪製圓圖Matlab
- 28. 在地圖視圖上繪製MKCircle
- 29. 在世界地圖上繪製圖形
- 30. 在地圖上繪製覆蓋圖