所以我一直在四處尋找並嘗試不同的代碼,我無法真正實現我想要的。我希望找到我在這裏尋找的東西。在numberpad中添加邊框到按鈕上的按鈕並在空白區域添加+符號
我想製作一個自定義數字鍵盤。這是我想要的結果:
但是,這是接近我得到。
第一個問題是,我不能得到的應用和取消按鈕有邊框。我該如何解決這個問題?
第二個問題是我想在我的數字鍵盤上添加+ *#按鈕。我到底該怎麼做?
這是代碼即時通訊與合作:
self.numberToolbar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 50)];
self.numberToolbar.barStyle = UIBarStyleBlackTranslucent;
self.numberToolbar.items = [NSArray arrayWithObjects:
[[UIBarButtonItem alloc]initWithTitle:@"Cancel" style:UIBarButtonItemStylePlain target:self action:@selector(cancelNumberPad)],
[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],
[[UIBarButtonItem alloc]initWithTitle:@"Apply" style:UIBarButtonItemStyleDone target:self action:@selector(doneWithNumberPad)],
nil];
[self.numberToolbar sizeToFit];
self.driverNumber.inputAccessoryView = self.numberToolbar;
如果有一個標題/圖像是「」+ *#「'」的按鈕, – matt 2015-01-20 19:11:58
第一張照片是舊的iOS 6和之前的外觀。底部圖片是新的iOS 7及更新的外觀。按鈕不再有邊框。 – rmaddy 2015-01-20 19:12:11
使用電話型鍵盤而不是數字鍵盤鍵盤。 – rmaddy 2015-01-20 19:13:28