ios - ScrollView not working programtically -


जेस्ट मैंने प्रोग्राम को ScrollView की कोशिश की। यह काम कर रहा है ViewController.m मैंने ऐसा करने की कोशिश की

  scroll = [[UIScrollView alloc] init]; Scroll.frame = CGRectMake (0, 50, self.view.frame.size.width, self.view.frame.size.height); scroll.delegate = आत्म; scroll.scrollEnabled = हाँ; Scroll.contentSize = CGSizeMake (100, 525); Scroll.backgroundColor = [UIColor yellowColor]; [Self.view addSubview: scroll]; Goo = [[UIButton alloc] init]; Goo.frame = CGRectMake (0, 50, 100, 100); Goo.backgroundColor = [UIColor brownColor]; [Goo setTitle: @ "अच्छा दिन" forState: UIControlStateNormal]; [Goo addTarget: स्वयं कार्रवाई: @ सिलेक्टर (ठीक है :) कंट्रोल ईवेंट्स: यूआईसीओन्ट्रॉलइवेंटटीचडाउन]; [स्क्रॉल ऐड एस्यूब्यूव्यू: goo];  

काम अच्छा है लेकिन एक ही कोड SecondViewControl

  - (शून्य) ठीक में काम नहीं कर रहा है: (आईडी) प्रेषक {द्वितीय * सेकंड = [[दूसरा आलोक] initWithNibName: शून्य बंडल: शून्य]; [दूसरा सेटमॉडल ट्रान्सिशन स्टाइल: यूमोडल ट्रान्सिशनशैलीफ़्लिपहॉरिज़ॉन्टल]; [आत्म वर्तमान ViewController: दूसरा एनिमेटेड: हाँ पूरा: शून्य]; }  

दूसरा.एम

  स्क्रॉल = [[UIScrollView alloc] init]; Scroll.frame = CGRectMake (0, 50, self.view.frame.size.width, self.view.frame.size.height); scroll.delegate = आत्म; scroll.scrollEnabled = हाँ; Scroll.contentSize = CGSizeMake (100, 525); Scroll.backgroundColor = [UIColor yellowColor]; [Self.view addSubview: scroll];  

मुझे समझ में नहीं आ रहा है कि क्यों scrollView second.m में काम नहीं कर रहा है, लेकिन ViewControl.m पर काम कर रहे समान कोड मेरा एक्सकोड संस्करण 6.0.1

कृपया modalViewController की बजाय वर्तमान ViewController और UIScrollView से SecondViewController

के प्रतिनिधि सेट करें।

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

asp.net mvc - How to attach sql database to a javascript graph -

c# - How to know the number of Threads created and limit the Tasks accordingly -