UI thread

2023-01-21   ES  

#pragma Mark Calculating Text Size (single -line text) 
 - (CGSIZE) AutoSizeofsignellinetext: (NSSTRING *) Text Font: (UIFONT *) FONT 
 {{ 
     Cgsize textsize = [Text Sizewithattributes:@{nsfontattributename: font}]; 
     Return TextSize; 
 } 


 #Pragma Mark Calculating UILABEL size (single -line text) 
 - (CGSIZE) AutoSizeofsignellinelabel: (Uilabel *) label 
 {{ 
     Cgsize textsize = [label.text Sizewithattributes:@{nsfontattributename: label.font}]; 
     Return TextSize; 
 } 

 #Pragma Mark Calculating UILABEL size (multi -line text) 
 // Uilabel's numberoflines set to 0 to 0 
 //label.numberoflines = 0; // Any line of line 
 - (CGSIZE) AutoSizeofmultipleLineLabel: (Uilabel *) label 
 {{ 
     Cgsize textsize = [label.text boundingrectwithsize: cgsizemake (self.View.frame.size.width, FLT_MAX) 
                                                options: NSSTRINGRAWINGISESLINEFRAGMENTONTONTONTONTONTONTONTONTONTONTONTONTO 
                                             Attributes:@{nsfontattributename: label.font} 
                                                context: nil] .size; 
     Return TextSize; 
 }

source

Related Posts

[Ruby-0] Regular Expression CPLUS

Blue Bridge Cup largest public sub -skewers Phoebe

MAC configuration ADB environment variable

date and time type

UI thread

Random Posts

[Linux] IMX6ULL Audio Drive-Power Management

qt5.6.1 Compile and connect Oracle11GR2

S5PV210 Development and Learning: LINUXQT System Start LOG

Use JavaScript to implement two functions: 1. Switch the entire selection/unattended text; 2. Update the full box status according to the selected number; learn/lesson2/12 …

1 1 1 1 1 1369 merged fruit