From: Christian M. <c.m...@we...> - 2010-01-11 18:25:38
|
Hello, i'm trying to add an UIPickerView-Item to my iPhoneApp. This works but i cant see any data in it. I saw a tutorial-video and implemented the necessary Methods and Interfaces but nothing happend. It doesn't work and I really don't know why. Can anybody help me please? Here is my code: ------------------------------------ UIPickerView picker = new UIPickerView(); widthFrame = picker.getBounds().size.width = 250; CGRect framePicker = new CGRect(horizontalAlignment(bounds.size.width, widthFrame),200,widthFrame,250); picker.setFrame(framePicker); //horizontalAlignment() is a self written Method picker.setDelegate(new UIPickerViewDelegate() { @Override public String titleForRow(UIPickerView view, int row, int component) { return s[row]; } }); picker.setDataSource(new UIPickerViewDataSource() { @Override public int numberOfComponentsInPickerView(UIPickerView view) { return 1; } @Override public int numberOfRowsInComponent(UIPickerView view, int component) { return s.length; } }); picker.selectRow(1, 0, false); picker.rowSizeForComponent(4); ViewNewReport.addSubview(picker); } static String s[] = new String[3]; @Override public void viewDidLoad() { super.viewDidLoad(); s[0] = "One"; s[1] = "Two"; s[2] = "Three"; } Thank you, Christian Mansch ______________________________________________________ GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT! Jetzt freischalten unter http://movieflat.web.de |