84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
学习是最好的投资!
Swift:
let leftBtn = UIButton(type: UIButtonType.Custom) leftBtn.frame = CGRectMake(0, 0, 65, 35) leftBtn.setImage(UIImage(named: "icon_xm_homepage_downArrow"), forState: UIControlState.Normal) leftBtn.adjustsImageWhenHighlighted = false
// leftBtn.setTitleColor(UIColor.brownColor(), forState: UIControlState.Normal) //Set button font color
leftBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignment.Center leftBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -50, 0, 0) leftBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 45, 0, 0) leftBtn.setTitle("天津", forState: UIControlState.Normal) leftBtn.addTarget(self, action: "showLeft", forControlEvents: UIControlEvents.TouchUpInside) self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(customView: leftBtn)
Similar small icons generally have the following methods:
Use css sprites to set background-position to set this kind of small picture
Use an icon library, the more popular ones are Alibaba vector graphics library or bootstrap font icons
You can just write a caret-down class using css yourself
Meituan should use css sprites, which are relatively popular, have better compatibility and consume relatively less resources
It’s just a picture
http://s1.meituan.net/www/css/si/base.v21effb81.pngPictures, pick the one you like~
Try fontAwesome
Swift:
// leftBtn.setTitleColor(UIColor.brownColor(), forState: UIControlState.Normal) //Set button font color
Similar small icons generally have the following methods:
Use css sprites to set background-position to set this kind of small picture
Use an icon library, the more popular ones are Alibaba vector graphics library or bootstrap font icons
You can just write a caret-down class using css yourself
Meituan should use css sprites, which are relatively popular, have better compatibility and consume relatively less resources
It’s just a picture
http://s1.meituan.net/www/css/si/base.v21effb81.png
Pictures, pick the one you like~
Try fontAwesome