2012-09-25 46 views
10

मैं एक आईफोन एप्लिकेशन पर काम कर रहा हूं और मुझे एक बड़ा टेक्स्ट प्रदर्शित करने की आवश्यकता है। मुझे अनुच्छेद संरेखण की आवश्यकता है। स्पष्टीकरण के लिए कृपया नीचे दी गई तस्वीर देखें।यूलाबेल पैराग्राफ टेक्स्ट संरेखण

मैंने UILabel और UITextView का उपयोग करने की कोशिश की लेकिन संपत्ति को ऐसा करने में नहीं मिला।

किसी भी मदद के लिए धन्यवाद।

enter image description here

+1

एक स्पष्ट, संक्षिप्त के लिए +1, अच्छी तरह से सचित्र सवाल – Damo

+0

चेक इस लिंक http://stackoverflow.com/ प्रश्न/737840 9/uilabel-justify-left-and-right यह आपकी मदद करेगा, यह आपके प्रश्न के समान है। –

उत्तर

1

उपयोग TTTAttributedLabel NSAtributedString लेबल जो UITextAlignmentJustify

yourTTTAttributedLabel.textAlignment = UITextAlignmentJustify; 

है इसके अलावा एक और विकल्प का उपयोग OHAttributedLabel NSAtributedString लेबल जो UITextAlignmentJustify

yourOHAttributedLabel.textAlignment = UITextAlignmentJustify; 
1

UITextView और UILabel वे इस तरह के संरेखण प्रदान न है। आप इसके बजाय UIWebview का उपयोग कर सकते हैं।

आप का उपयोग <p style="text-align:justify">Your text goes here.</p>

यह उपयोगी हो सकता है कर सकते हैं।

1

ios> 7.1 NSTextAlignmentJustified करने के लिए सिर्फ सेट textAligment संपत्ति, किसी भी तृतीय-भाग पुस्तकालयों के बिना के लिए:

UILabel *label = [UILabel alloc] init]; 
label.textAligment = NSTextAlignmentJustified;