草庐IT

add_custom_target

全部标签

iphone - 如果我们点击 UITableView 中的 Custom Section Header,然后将该部分移动到顶部

我在UITableView中有一个CustomSectionHeader,在该节标题上,在其最右边放置了UIButton。我想要的是,如果我点击UIButton,那个特定的SectionHeader应该滚动到顶部。就是这样任何建议,一段代码都会受到赞赏。 最佳答案 第1步:设置章节标题的大小。示例如下。-(CGFloat)tableView:(UITableView*)tableViewheightForHeaderInSection:(NSInteger)section{return55;}第2步:创建并返回自定义部分标题。-(U

objective-c - Objective-C : How to add "plus" button in cell

谁能告诉我如何在UITableView单元格中添加“加号”按钮,就像您在下面的屏幕截图中看到的那样? 最佳答案 您还可以将TableView置于编辑模式,实现editingStyleForRowAtIndexPath:并返回UITableViewCellEditingStyleInsert(它会放置一个带加号的绿色圆圈)。例如……-(IBAction)editButtonPressed{//toggleeditingon/off...[tableViewsetEditing:(!tableView.editing)animated:

objective-c - iPhone 开发 : how to use custom fonts?

我在我的photoshop设计中使用了一种特殊的字体,是否可以在iPhone应用程序中原生使用这些字体?或我需要先将它们转换成图像吗?如果这是唯一的方法,那么您如何处理动态文本? 最佳答案 将字体文件复制到资源中在您的应用程序.plist中创建(如果存在,只需创建一行)名为“应用程序提供的字体”的行,然后在“项目0”中复制您的字体名称,例如“Ciutadella-Bold.otf”(如果字体名称中有一些空格,请将其重命名,例如将所有空格替换为减号'-')然后你可以在你的应用程序中定义这个字体:UIFont*CiutadellaBol

android - 谷歌地图 : custom LocationSource in iOS

我已经构建了一个Android应用程序,它能够使用Googlemap显示用户的地理位置,以及除Wifi、手机和GPS之外的一些附加信息,例如QR码、信标或任何我可以用来表示当前位置的信息(我没有考虑这些位置的实际准确性)。我正在使用LocationSource并通过setLocationSource将其传递给GoogleMapsAPI.我必须使用Googlemap,因为Applemap的可用缩放级别有限,所以我无法放大建筑物。是否可以提供一个自定义的LocationManager,它会通过某些操作定期更新并将其注入(inject)GoogleMapsAPI,如LocationSourc

ios - 初学者 : How to add top bar with buttons on UITableViewController

我是iOS开发新手,Storyboard中只有UITableViewController。我想用一些按钮向它添加一个顶部栏,该怎么做?注意,我正在使用由“Storyboard”创建的UITabBar,而我的ITableViewController是UITabBar的一项。 最佳答案 当您创建UITableViewController时,请执行以下操作:UINavigationController*navigationController=[[UINavigationControlleralloc]initWithRootViewCo

iOS 7 : Custom UITableViewCell content doesn't move expected on editing?

我正在编辑自定义UITableViewCell。当我进入编辑模式时,标签和图像没有正确移动。-(IBAction)EditTable:(id)sender{UIButton*btn=(UIButton*)sender;if(self.editing){[supersetEditing:NOanimated:NO];[btnsetTitle:@"edit"forState:UIControlStateNormal];[tblViewsetEditing:NOanimated:NO];}else{[supersetEditing:YESanimated:YES];[btnsetTitle:

ios - swift : retrieving text from a UITextField in a custom UITableViewCell and putting it in an array

我正在制作一个非常简单的应用程序,用户可以在第一个屏幕中输入人数。在第二个屏幕中它生成了一个数字UITableViewCell基于用户在第一个屏幕中输入的数字。UITableViewCell有一个UITextField在它们中,一旦用户点击转到第三个屏幕,我就会尝试将在这些字段中输入的数据存储在一个数组中。我该怎么做?提前致谢!编辑:我正在使用Storyboard。这是调用自定义UITableViewCell的代码看起来像我的UIViewController:functableView(tableView:UITableView,cellForRowAtIndexPathindexPa

iphone - iOS UIActivity View Controller : Add To Reading List Button?

是否有一项服务能够从应用程序中将URL添加到iOSSafari的阅读列表。我有一个要添加的url和一个UIWebView,但我已经研究过但找不到任何东西。这是我的工作UIActivityViewController。-(IBAction)actionButton:(id)sender;{NSLog(@"shareButtonpressed");NSURL*URL=[NSURLURLWithString:self.feedItem[@"url"]];//thisisyourtextstringNSArray*activityItems=@[URL];ARChromeActivity*ch

ios - 使用 UITableView registerNib : to load a custom UITableViewCell from nib? 时如何分配文件所有者

所以我一直在考虑使用UITableView'sregisterNib:和[dequeueReusableCellWithIdentifier:forIndexPath:]加载自定义来自NIB的UITableCellView。以下是我的Controller的重要部分:-(void)viewDidLoad[superviewDidLoad];self.tableView.bounces=NO;[self.tableViewregisterNib:[UINibnibWithNibName:@"ProgramListViewCell"bundle:nil]forCellReuseIdentif

php - socket_connect() : unable to connect [10061] - target machine actively refused it

我正在尝试使用PHPsocket_connect()函数连接用C编写的目标,但出现以下错误:警告:socket_connect():无法连接[10061]:无法建立连接,因为目标机器主动拒绝。这是我正在运行的代码:$service_port=1234;$address="xx.xxx.xx.xxx";$socket=socket_create(AF_INET,SOCK_STREAM,SOL_TCP);if($socket===false){echo"socket_create()failed:reason:".socket_strerror(socket_last_error())."