1
我新的iOS和工作Google Map SDK
,並能夠顯示在視圖中的地圖,但現在添加的UITextField和UIButton的谷歌地圖上
- 我想添加一個
UITextField
和那邊 輸入位置
- 按鈕上單擊該位置應在地圖
顯示所以,請您幫助我。
我新的iOS和工作Google Map SDK
,並能夠顯示在視圖中的地圖,但現在添加的UITextField和UIButton的谷歌地圖上
UITextField
和那邊顯示所以,請您幫助我。
我建議你添加的UINavigationBar的,或者通過將UIToolBar在地圖視圖的頂部,然後通過點擊它顯示與文本框一個UIAlertView中這需要在輸入後按鍵警報的確定是按下輸入的位置,並做你的東西。不要在地圖上添加按鈕,這會降低可用性因數。
如果你有一個導航欄已經,嘗試這種
UIBarButtonItem *locationButton = [[UIBarButtonItem alloc] initWithTitle:@"location" style:UIBarButtonItemStyleBordered target:self action:@selector(showAlertWithTextField)];
self.navigationItem.rightBarButtonItem=locationButton;
-(void)showAlertWithTextField{
UIAlertView* dialog = [[UIAlertView alloc] initWithTitle:@"Enter Location" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Add", nil];
[dialog setAlertViewStyle:UIAlertViewStylePlainTextInput];
[dialog show];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 1)
NSLog(@"%@",[[alertView textFieldAtIndex:0]text]);
}
K I得到了UR點兄弟,u能請給我如何在textfeild進入的地方進行搜索在谷歌地圖視圖的任何樣品。 –
k thanx brother .... –
它運作?如果是這樣,請接受/提出答案。 – satheeshwaran