[Code Note] sets the row spacing method of textView or label, textviewlabel
I ,.
Ii. Code.
RootViewController. m
-(Void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view. // UILabel * label = [[UILabel alloc] initWithFrame: CGRectMake (50,100,200,300)]; label. backgroundColor = [UIColor orangeColor]; label. text = @ "in 3000 BC, the number of residents in the Indian River Basin was widely used, and the residents adopted the decimal calculation method. To the Veda age (1500-BC ~ In 500 BC), yalian people realized the role of numbers in production activities and daily life and created some simple and incomplete figures. In the 3rd century BC, a set of numbers appeared in India, but different languages were written. The most typical of them was Brahman. Its uniqueness was from 1 ~ 9 each number has a special symbol, and modern numbers are born from them. At that time, "0" had not yet appeared. In the age of multiple regions (300 ~ In 500, "0" was available, called "Shun RuO" (shunya), indicating that the method was a black spot "●", and then evolved into "0 ". In this way, a complete set of numbers is generated. This labor creation has also made great contributions to the world culture. "; Label. numberOfLines = 0; [self. view addSubview: label]; // set the row spacing NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle. lineSpacing = 50; NSDictionary * attributes = @ {NSFontAttributeName: [UIFont systemFontOfSize: 14], NSParagraphStyleAttributeName: paragraphStyle}; label. attributedText = [[NSAttributedString alloc] initWithString: label. text attributes: attributes];}