所以我有一个非常复杂的项目.我正在使用接口构建器和xcode直接构建对象.现在我将UIScrollViews构建在IB中,他们需要在那里构建,并在这些滚动视图之上构建UIButton.在同一个地方有几个滚动视图,但这真的不应该有很大的不同.
无论如何,问题是它在iPhone 4上完美运行.但是当在iPhone 5上构建时,它将Scrollviews移动到屏幕的底部,在此之前它是x = 0,y = 361.所有其他对象都正确放置,下方有一些空白区域.我知道如何检查iPhone 5:
我不知道如何在这里用颜色和诸如此类的方法发布代码,它们使它变得非常复杂,所以这里是我将如何做if/then:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480){
// iPhone Classic
}
if(result.height == 568){
// iPhone 5
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道如果/然后在IB中有办法.我尝试过这样手动更改位置:
[peopleScrollView scrollRectToVisible:CGRectMake(0, 449, 320, 58) animated:NO];
Run Code Online (Sandbox Code Playgroud)
那没用.那么,我要问的是有没有办法在代码本身中更改UIScrollView的位置?如果没有,那么我想我将不得不在代码中手动构建所有5个UIScrollViews,我绝对不想这样做.
我正在尝试用自定义CSS创建一个表,我不知道我做错了什么.之前已完成此操作,但由于某种原因我无法获得出现的缺口CSS ...只显示一个没有样式的空白表.
CSS:
table.300yardsTable{background:#EEE;color:#333;font-size:14px;text-align:center;}
table.300yardsTableHeader tr{background:#CCC;font-weight:bold;}
table.300yardsRow tr{background:#EEE;color:#333;}
table.300yardsRow:hover tr{background:#242424;color:#CCC;}
Run Code Online (Sandbox Code Playgroud)
表:
<table width="600" border="1" align="center" cellpadding="2" cellspacing="2" class="300yardsTable">
<tr class="300yardsTableHeader">
<td width="25%">LOFT</td>
<td width="25%">HAND</td>
<td width="25%">LIE</td>
<td width="25%">VOLUME</td>
</tr>
<tr class="300yardsRow">
<td>8*-12*</td>
<td>RH/LH</td>
<td>61*</td>
<td>460cc</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud) 好的,所以sendSMS在ios7及以下版本之前工作正常.但是,在ios8上,sendSMS函数失败,问题标题中出现错误.我在这里得到一个警告(尝试通过使用其他堆栈溢出问题将NSArray更改为NSString来解决):不兼容的指针类型从"NSString*"为controller.recipients = recipients分配给'NSArray*'; 它返回MessageComposeResultCancelled的结果.
if (ABMultiValueGetCount(phoneNumbers) > 0) {
phone = (__bridge_transfer NSString*)
ABMultiValueCopyValueAtIndex(phoneNumbers, 0);
[self sendSMS:@"Play me on PokerBuddies.
Download the app at: https://itunes.apple.com/us/app /poker-buddies/id404168013?mt=8"
recipientList:[NSString stringWithFormat:phone, nil]];
} else {
phone = @"[None]";
}
- (void)sendSMS:(NSString *)bodyOfMessage recipientList:(NSString *)recipients{
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText]){
controller.body = bodyOfMessage;
controller.recipients = recipients;
controller.messageComposeDelegate = self;
[self presentViewController:controller animated:YES completion:nil];
NSLog(@"Send SMS");
}
}
Run Code Online (Sandbox Code Playgroud)