我想制作一个带有三角形图标的按钮,就像iBooks app风格一样.

按下按钮时,将显示列表屏幕.然后选择一个列表,按钮的语句将是所选文本和三角形的图标.图标始终是右侧.
[self.button setImage:[UIImage imageNamed:@"arrow-down"] forState:UIControlStateNormal];
CGFloat titleWidth = self.button.titleLabel.bounds.size.width;
CGFloat imageWidth = self.button.imageView.bounds.size.width;
// Title is left Image is right
self.button.titleEdgeInsets = UIEdgeInsetsMake(0, -imageWidth, 0, imageWidth);
self.button.imageEdgeInsets = UIEdgeInsetsMake(0, titleWidth, 0, -titleWidth);
Run Code Online (Sandbox Code Playgroud)
所以我试着制作一个示例应用程序.
https://github.com/kawai-hiroyuki/LikeIBooksDropDownMenu
但是,图标的位置绝对会偏离.如何安装在右侧始终是图标.