我想在ios 8的警报视图中添加文本输入.我知道它已经完成,UIAlertController
但没有任何想法.怎么做 ?
我做了什么: -
我已经添加了在单元格完全可见时播放视频的代码,当我向下或向上滚动时,它会再次重新加载tableview并再次播放视频.但是,我的要求是不同的.
我真正想要的是:
我想播放视频,直到完全可见的向后或向前的单元格.当用户向下滚动或向上滚动时,它不会影响直到完全可见的向后或向前单元格.
设计
Table Cell Layout Description
-> Video Table Cell (Fix height 393)
-> Content View
-> Main view - (as per Content view of Table view Cell)
-> Title View (0, 0, MainView.width, 57)
-> Video View (0, 57, MainView.width, 200);
-> Description View (0, 257, MainView.width, 136)
Run Code Online (Sandbox Code Playgroud)
编码:
VideoTableCell.h
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
@interface VideoTableCell : UITableViewCell
@property (strong, nonatomic) IBOutlet UIView *viewForVideo;
@property (strong, nonatomic) IBOutlet UIImageView *imgThumb;
@property (strong, nonatomic) IBOutlet UIButton …
Run Code Online (Sandbox Code Playgroud) 我在演示应用程序中实现了Facebook App邀请.它工作正常,但没有收到通知.
我在我的问题中添加了所有细节,现在任何人都可以告诉我代码中的问题是什么,我该怎么做才能解决这个问题.我已经创建了测试用户来测试这个应用程序.
此代码工作正常,它启动一个对话框,显示朋友列表,并显示应用程序邀请已发送,但当我在朋友帐户中检查它时,它不显示任何通知.
我的Info.plist文件
我认为我在URL类型(URL Schemes)下的info.plsit中有错误.我写了一个动作,这是该方法的名称,但我不知道我应该在本专栏中写些什么.
Appdelegate.m
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
BFURL *parsedUrl = [BFURL URLWithInboundURL:url sourceApplication:sourceApplication];
if ([parsedUrl appLinkData])
{
NSURL *targetUrl = [parsedUrl targetURL];
[[[UIAlertView alloc] initWithTitle:@"Received link:"
message:[targetUrl absoluteString]
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil] show];
}
return YES; }
Run Code Online (Sandbox Code Playgroud)
ViewController.h
appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results
调用时获得结果为null
- (IBAction)action:(UIButton *)sender
{
FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init];
content.appLinkURL = [NSURL URLWithString:@"https://fb.me/*****************"];
[FBSDKAppInviteDialog showFromViewController:self withContent:content delegate:self];
}
- (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results
{
NSLog(@" result %@",results);
} …
Run Code Online (Sandbox Code Playgroud) objective-c facebook-graph-api ios facebook-ios-sdk facebook-invite-friends
当前视图控制器不使用ios 9,当我按下按钮时它没有重定向到当前视图控制器.
为什么会这样?
我试过下面的代码
RegistrationViewController * viewController =[[UIStoryboard storyboardWithName:@"Registration" bundle:nil] instantiateViewControllerWithIdentifier:@"RegistrationViewController"];
[self presentViewController:viewController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
我也试过下面的代码
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"Registration"
bundle:nil];
RegistrationViewController *add =
[storyboard instantiateViewControllerWithIdentifier:@"RegistrationViewController"];
[self presentViewController:add animated:YES completion:^{
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:add
animated:YES
completion:nil];
});
}];
Run Code Online (Sandbox Code Playgroud)
编辑
我的完整代码在这里.我正在使用Xcode 7并使用ios 9运行它
#import "LoginViewController.h"
#import "RegistrationViewController.h"
@interface LoginViewController ()
@end
@implementation LoginViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can …
Run Code Online (Sandbox Code Playgroud) 我试图从我的iOS应用程序发送短信应用程序的短信,但它没有成功.我在下面添加了我的代码,请告诉我我做错了什么.我的设备安装了什么应用,但我仍然无法发送任何短信.
- (IBAction)whatAppInvite:(id)sender
{
NSString * strTextPost = [@"" stringByAppendingFormat:@"Hey try this app. Its amazing. \n\n https://itunes.apple.com/us/app/google-search/*********2?mt=8"];
strTextPost = [strTextPost stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
strTextPost = [strTextPost stringByReplacingOccurrencesOfString:@":" withString:@"%3A"];
strTextPost = [strTextPost stringByReplacingOccurrencesOfString:@"/" withString:@"%2F"];
strTextPost = [strTextPost stringByReplacingOccurrencesOfString:@"?" withString:@"%3F"];
strTextPost = [strTextPost stringByReplacingOccurrencesOfString:@"," withString:@"%2C"];
strTextPost = [strTextPost stringByReplacingOccurrencesOfString:@"=" withString:@"%3D"];
strTextPost = [strTextPost stringByReplacingOccurrencesOfString:@"&" withString:@"%26"];
strTextPost = [strTextPost stringByReplacingOccurrencesOfString:@"." withString:@"%2E"];
strTextPost = [strTextPost stringByReplacingOccurrencesOfString:@"'" withString:@"%27"];
strTextPost = [strTextPost stringByReplacingOccurrencesOfString:@"-" withString:@"%2D"];
NSString * urlWhats = [NSString stringWithFormat:@"whatsapp://send?text=%@",strTextPost];
NSURL * whatsappURL = [NSURL URLWithString:urlWhats]; …
Run Code Online (Sandbox Code Playgroud)