下面的代码很有效,除了电子邮件在一行上有所有文本,如下所示:高度:60 | 对角线:123 | 宽度:107 | 总SF:13.92 | 每SF成本:450 | 总费用:$ 6,264.00
我想在每次之后打破所以它看起来像这样:
高度:60
对角线:123
宽度:107
总SF:13.92
每SF成本:450
总成本:$ 6,264.00
我试过\n\r \n\r \n等,但它们都没有用.有任何想法吗?
<a class="emailText" href="mailto:?subject=Screen Dimensions" onclick="this.href='mailto:?subject=Screen Dimensions&body='+'Height: '+document.forms.myform.high.value+' | '+'Diagonal: '+document.forms.myform.diagonal.value+' | '+'Width: '+document.forms.myform.wide.value+' | '+'Total SF: '+document.forms.myform.sf.value+' | '+'Cost Per SF: '+document.forms.myform.csf.value+' | '+'Total Cost: '+document.forms.myform.tc.value">Email</a>
Run Code Online (Sandbox Code Playgroud) 我刚从一个网站安装了一个应用程序 - 没有配置文件,没有UDID,没有任何东西.它刚刚开始安装.这怎么可能?我没有越狱,没有运行新的测试版6.当它完成安装后我点了它,它问我是否确定我想运行这个应用程序.
我知道系统默认代码段的位置,但找不到我的两个新代码段.基本上,我想添加我以前的片段集合.为了能够找到它们,我做了两个新的.没工作.有什么建议?
我想知道如何在uiimageview上设置遮罩的比例.附加示例图像.灰色框是我的uiviewcontroller的图像背景,不是问题的一部分.
我假设创建了一个uiview子类,我传递了一个图像,一个半径和一个中心点.然后(?)创建一个掩码,然后来回动画它?
谁能指出我正确的方向?圆圈可放置在任何大小的任何位置,但要显示的图像始终为全屏.
最后,我将添加一种方法来缩小圆圈.但是一步一步.
谢谢你的指导,
-e
谢谢布鲁克斯.你的问题让我不断深入研究文件是否存在于我的包中 - 而事实并非如此!
所以通过使用这个代码(也在下面):iPhone/iPad:无法将文件夹从NSBundle复制到NSDocumentDirectory以及向Xcode正确添加目录的说明(从这里和下面)我能够使它工作.
将文件夹复制到Xcode:
目录应显示为蓝色而不是黄色.
-(void) copyDirectory:(NSString *)directory {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *documentDBFolderPath = [documentsDirectory stringByAppendingPathComponent:directory];
NSString *resourceDBFolderPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:directory];
if (![fileManager fileExistsAtPath:documentDBFolderPath]) {
//Create Directory!
[fileManager createDirectoryAtPath:documentDBFolderPath withIntermediateDirectories:NO attributes:nil error:&error];
} else {
NSLog(@"Directory exists! %@", documentDBFolderPath);
}
NSArray *fileList = [fileManager contentsOfDirectoryAtPath:resourceDBFolderPath error:&error];
for (NSString *s in fileList) {
NSString …
Run Code Online (Sandbox Code Playgroud)我有很多应用程序依赖于基于tapped像素的rgb值检查.如果我点击一个返回128/128/138的像素,那么它会从数组中打开这个特殊的东西.使用9.3这不再有效,因为我得到了疯狂的颜色值.
我做了一些挖掘,发现iOS现在支持颜色配置文件.我的文件根本没有关联的个人资料.这似乎是个问题.
自视网膜3以来的每个显示器都返回了稍微不同的饱和度,这是我必须调整的.但这揭示了一个更大的问题(至少对我而言).
有没有办法在iOS 9.3中禁用颜色配置文件管理?如果是这样,也许检查看看我在运行什么操作系统,然后才禁用它?或者可以添加一个配置文件(在9.3以下被忽略)这将使它们在9.3上工作?
谢谢
我试图在我的AVPlayer中平移并寻找前进和后退.它有点工作,但确定平移转换为资产长度的基本数学是错误的.任何人都可以提供协助吗?
- (void) handlePanGesture:(UIPanGestureRecognizer*)pan{
CGPoint translate = [pan translationInView:self.view];
CGFloat xCoord = translate.x;
double diff = (xCoord);
//NSLog(@"%F",diff);
CMTime duration = self.avPlayer.currentItem.asset.duration;
float seconds = CMTimeGetSeconds(duration);
NSLog(@"duration: %.2f", seconds);
CGFloat gh = 0;
if (diff>=0) {
//If the difference is positive
NSLog(@"%f",diff);
gh = diff;
} else {
//If the difference is negative
NSLog(@"%f",diff*-1);
gh = diff*-1;
}
float minValue = 0;
float maxValue = 1024;
float value = gh;
double time = seconds * (value - minValue) / (maxValue …
Run Code Online (Sandbox Code Playgroud) 我需要点击一个UIImageView
...
...并将点击位置的颜色与从资产目录返回的颜色(或在代码中创建的自定义颜色)进行比较。
我在色彩空间方面遇到了很多麻烦,我的比赛总是没有。我已经阅读了一些关于 stackoverflow 的很棒的例子并尝试了它们,但我一定还是做错了什么。
我还尝试使用这样的自定义颜色(而不是资产颜色):
+ (UIColor *)themeRed {
return [UIColor colorWithRed:192.0f/255.0f green:92.0f/255.0f blue:42.0f/255.0f alpha:1];
}
Run Code Online (Sandbox Code Playgroud)
仍然没有匹配项。我的测试匹配代码如下:
-(void)tappedColorView:(UITapGestureRecognizer *)tapRecognizer {
CGPoint touchPoint = [tapRecognizer locationInView: uiiv_hs];
//NSLog(@"my color %@", [uiiv_hs colorOfPoint:touchPoint]);
UIColor *color = [uiiv_hs colorOfPoint:touchPoint];
NSLog(@"color %@",[uiiv_hs colorOfPoint:touchPoint]);
UIColor *matchcolor = [UIColor themeRed];
NSLog(@"mcolor %@",[UIColor themeRed]);
NSArray *colors = [NSArray arrayWithObjects:[UIColor colorNamed:@"Color01"],[UIColor colorNamed:@"Color02"], nil];
if ([color matchesColor:matchcolor error:nil]) {
NSLog(@"1Match!");
} else {
NSLog(@"1No Match!");
}
if ([color isEqualToColor:[UIColor …
Run Code Online (Sandbox Code Playgroud) 我有一些代码可以在uiview中创建,添加和标记uiview中的unbuttons.在某一点上,我尝试用某些标签更改(背景颜色和图像)一些解开按钮.问题是如果我选择带有标记0的第一个按钮,for循环炸弹用于图像更改,因为uiscrollview或uiview没有该方法可用.但我试图只针对视图中的解开按钮(全部同步).如果我选择任何其他按钮,它按预期工作.我可以将标签从0偏移到1,但我想知道为什么我的for循环不起作用.
for (int i=0; i<[devicesArray count]; i++) {
NSLog(@"red %i", i);
for (UIView *subview in [uiv_ButtonsView subviews]) {
if([subview isKindOfClass:[UIButton class]]) {
int number = [[devicesArray objectAtIndex:i] intValue];
subview.alpha=1.0;
[[subview viewWithTag:number] setBackgroundColor:[UIColor redColor]];
UIButton *btttn = (UIButton *)[subview viewWithTag:number];
[btttn setBackgroundImage:nil forState:UIControlStateNormal];
}
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢 - 这是现在正在运行的代码:
for (int i=0; i<[devicesArray count]; i++) {
int number = [[devicesArray objectAtIndex:i] intValue];
[[uiv_Quilt viewWithTag:number] setBackgroundColor:[UIColor redColor]];
[[uiv_Quilt viewWithTag:number] setBackgroundImage:nil forState:UIControlStateNormal];
}
Run Code Online (Sandbox Code Playgroud) 我在分页滚动视图中有一系列uitextviews.我想让每个页面内的文本在一个倾斜的矩形(平行四边形)内流动.图像附加(我希望文本在白色轮廓内流动).
代码如下.
for (int i = 0; i < imageArray.count; i++) {
CGRect framee;
framee.origin.x = self.uis_scrollView.frame.size.width * i;
framee.origin.y = 0;
framee.size = self.uis_scrollView.frame.size;
UITextView *newTextView = [[UITextView alloc] initWithFrame:framee];
UIBezierPath* rectanglePath = [UIBezierPath bezierPath];
[rectanglePath moveToPoint: CGPointMake(652, 687)];
[rectanglePath addLineToPoint: CGPointMake(680, 687)];
[rectanglePath addLineToPoint: CGPointMake(746, 541)];
[rectanglePath addLineToPoint: CGPointMake(718, 541)];
[rectanglePath addLineToPoint: CGPointMake(652, 687)];
[rectanglePath closePath];
UIBezierPath * imgRect = rectanglePath;
newTextView.textContainer.exclusionPaths = @[imgRect];
[newTextView setBackgroundColor:[UIColor clearColor]];
[newTextView setTextColor:[UIColor whiteColor]];
[newTextView setFont:[UIFont systemFontOfSize:16]];
newTextView.text = [imageArray objectAtIndex:i];
newTextView.userInteractionEnabled …
Run Code Online (Sandbox Code Playgroud) 我想自动化许多具有cornerRadius设置的uiviews的比例因子,使它们看起来像圆圈.我们的想法是,这些20个不同大小和位置的圆形视图,无论其大小,位置等,都可以扩展以填充屏幕.
我的代码有一个硬编码值,我想让它变得聪明:
[UIView animateWithDuration:0.2 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.layer.affineTransform = CGAffineTransformMakeScale(15.0f, 15.0f);
} completion:^(BOOL finished) {
}];
Run Code Online (Sandbox Code Playgroud)
是的 - 我可以在CGAffineTransformMakeScale中输入20,但是更大的圆圈无缘无故地缩放 - 他们可能需要缩放11.
将原始尺寸计算为固定的,更大尺寸的方法是什么?
注意:圆形uiview是圆形的,应该足够大,圆形边缘不可见 - 它需要缩放到屏幕之外以填充角落处的间隙.
ios ×7
objective-c ×2
avplayer ×1
bundle ×1
cgcolorspace ×1
copy ×1
for-loop ×1
install ×1
ios7 ×1
ios9.3 ×1
iphone ×1
javascript ×1
line-breaks ×1
location ×1
mailto ×1
mask ×1
pixel ×1
seek ×1
silent ×1
tags ×1
uicolor ×1
uiimageview ×1
uitextview ×1
xcode ×1
xcode6 ×1