क्या कोई मुझे बता सकता है कि नीचे दिए गए स्क्रीन में आप देखे गए मार्जिन कहां से आ रहे हैं? मैं लाल, हरे और नीले आयतों को स्क्रीन लेआउट, परिदृश्य और चित्र दोनों में एक-दूसरे के बगल में फिट करने के लिए चाहता हूं। इसके बजाय मैं विचारों के बीच निष्पक्ष मार्जिन देखता हूं।बाएंबर्टनटैम के लिए इस मार्जिन तर्क को समझाएं, दाएं बार्टबटन इटिम, शीर्षक देखें
// Setup Left Bar Button item
UIBlankToolbar* tools = [[[UIBlankToolbar alloc] initWithFrame:CGRectMake(0, 0, 115, 44)] autorelease];
tools.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[tools setBackgroundColor:[UIColor greenColor]];
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:tools] autorelease];
...
// Setup Right Bar Button Item
UIBlankToolbar* tools = [[[UIBlankToolbar alloc] initWithFrame:CGRectMake(0, 0, 100, 44)] autorelease];
[tools setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
[tools setBackgroundColor:[UIColor redColor]];
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:tools] autorelease];
...
// Setup Title View
self.navigationItem.titleView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 44)] autorelease];
self.navigationItem.titleView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[self.navigationItem.titleView setBackgroundColor:[UIColor blueColor]];
मैं इस कोड के साथ क्या देखें:
क्या वास्तव में मुझे perplexes कि विचारों के बीच मार्जिन उपलब्ध स्थान के रूप में बड़ा हो छोटा हो जाता है है? मुझे समझ में नहीं आता कि वे वहां क्यों हैं, और न ही वे मार्जिन से क्या उम्मीद करते हैं, इसके विपरीत वे व्यवहार करते हैं।
धन्यवाद!
यदि आप लचीली चौड़ाई का उपयोग नहीं करते हैं तो क्या होता है? –
यदि मैं लचीली चौड़ाई का उपयोग नहीं करता हूं, तो हरा ब्लॉक बाईं ओर गठबंधन की समान चौड़ाई पर रहता है, नीले और लाल दाएं गठबंधन होते हैं, और हरे और नीले रंग के बीच एक बड़ा अंतर दिखाई देता है। लेकिन, उन अंतराल का अस्तित्व स्वयं ही है जो मुझे समझ में नहीं आता है। – esilver
अरे, वैसे, सेब डॉक्टर कहते हैं कि टाइटलव्यू को अनदेखा कर दिया जाएगा जब बार्टबटन आइटम शून्य नहीं है। क्या आपको इसकी जानकारी है? क्या आपके पास कामकाज है? – kris