0

在我的项目中,我想做一个垂直按钮,文本也是垂直的,,,有人帮忙吗?!

完全一样的东西

在此处输入图像描述

4

5 回答 5

1

Use this code to rotate the button

btn.transform = CGAffineTransformMakeRotation(-M_PI / 2);

And

btn.transform = CGAffineTransformMakeRotation(M_PI / 2);
于 2013-03-25T09:13:20.520 回答
0

You can instead rotate a button by using :

yrButton.transform = CGAffineTransformMakeRotation(90.0*M_PI/180.0);

This will give you 90 Degree rorate.

于 2013-03-25T09:13:13.300 回答
0

try like this i hope it'l helps you,

btn.transform= CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(270));

and define

#define DEGREES_TO_RADIANS(x) (M_PI * x / 180.0) 
于 2013-03-25T09:13:20.247 回答
0

You can use CGAffineTransform for this purpose, it does the rotation according to your choice

于 2013-03-25T09:13:49.883 回答
0

您可以通过转换来实现这一点。

顺时针旋转:

button.transform = CGAffineTransformMakeRotation(90.0*M_PI/180.0);

和逆时针:

button.transform = CGAffineTransformMakeRotation(-90.0*M_PI/180.0);

第一个数字(90.0 或 -90.0)指定旋转按钮的角度(以度为单位)。

于 2013-03-25T09:15:18.570 回答