简体   繁体   中英

Swift label under another label

How to implement one line above another, as in the screenshot. The translation must be strictly above the word. How to do it ?

在此处输入图片说明

Use CollectionView with flowLayout set to Horizontal, where UICollectionViewCell will hold 2 labels, one above another. Set top label's font smaller as you wish and larger for bottom label. Provide collecitonView's data source as pair of words, one for top label other for bottom label. And set collectionViewCell's UI as whole collectionView would appear as single label.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM