我发现我可以
[picker setToRecipients:[NSArray arrayWithObject:@"My Name <myname@example.com>"]];
Run Code Online (Sandbox Code Playgroud)
在编写电子邮件时,它很好地在"收件人:"字段中显示"我的姓名",并在我的iPad设备上正确地将其发送到myname@example.com.在iPad模拟器中看起来也不错(当然不能发送).
但iPhone模拟器只在合成屏幕上显示"1个收件人".不知道它是否会发送好,没有iPhone设备方便测试.
有没有其他人走这条路?有什么办法在iPhone组合屏幕上获取显示名称?
谢谢
这似乎不可能,我确信有一个简单的解决方案,但我无法解决.我的高中矩阵数学有点生锈:)
我正在构建一个CGAffineTransform
要进行a的平移 - 旋转 - 平移,CGRect
然后尝试使用反CGAffineTransformInvert返回到原始位置.但事实并非如此.我设法将它减少到这个:
// start building the transform...
// translate so (0,0) is at centre of image
CGAffineTransform affine = CGAffineTransformMakeTranslation(-100, -100);
// add a rotate
affine = CGAffineTransformConcat(affine, CGAffineTransformMakeRotation(M_PI/4));
// get the inverse
CGAffineTransform inverseAffine = CGAffineTransformInvert(affine);
// now test this: pick a starting CGRect
CGRect start = CGRectMake(50, 40, 10, 20);
// use my CGAffineTransform to move "start" to "midpoint"
CGRect midpoint = CGRectApplyAffineTransform(start, affine);
// use the inverse …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在同一视图中实现捏合和旋转.有时捏取选择器被调用,有时旋转一个,好吧,但随后它会坚持下去.问题显然gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
是没有被召唤.为什么不?得到明显的东西......
@interface FaceView : UIView <UIGestureRecognizerDelegate>
{
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
@end
@implementation FaceView
- (id)initWithFrame:(CGRect)frame
{
if( self = [super initWithFrame:frame] )
{
self.multipleTouchEnabled = YES;
self.userInteractionEnabled = YES;
UIRotationGestureRecognizer* rotationRecognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotationGesture:)];
[self addGestureRecognizer:rotationRecognizer];
[rotationRecognizer release];
UIPinchGestureRecognizer* pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchGesture:)];
[self addGestureRecognizer:pinchRecognizer];
[pinchRecognizer release];
}
return self;
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
NSLog(@"gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer");
return YES;
}
- (void)rotationGesture:(UIRotationGestureRecognizer*)gesture
{
switch( gesture.state )
{ …
Run Code Online (Sandbox Code Playgroud)