草庐IT

closed-cell

全部标签

iphone - iOS 5 : UITableView cells are not scrolling smooth

使用:iOS5、ARC、Storyboard。每个单元格上有1个图像和文本。滚动时图像不会调整大小。有两个版本的图片image.png和image@2x.png。自定义单元格是通过在Storyboard中使用UIImageView和UILabel来管理的。代码:-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{staticNSString*CellIdentifier=@"Cell";Continent*continent=[self.ite

ios - 有没有办法在 iBook 小部件中捕获 "closing"事件?

我有在iBook中运行的小部件。特别是,它们会播放一些音乐和声音,以及一个Javascript“主循环”。我希望只要用户关闭小部件,声音和音乐就会停止。我不知道iBook是否触发了类似“FocusLost”或“WidgetClosed”的事件。根据我目前的理解,这个用例不会触发“onunload”,因为只要iPhone决定回收一些内存,因为用户当前所在的页面需要它,这个用例就会运行。这个问题的标准解决方案是什么? 最佳答案 我使用focusout和blur事件的组合部分解决了这个问题,并将tabindex=1添加到小部件html元素

ios - 将单元格数据(即 cell.textlabel.text 和 cell.imageView.image)传递给另一个 View Controller

我有一个填充了数据(文本和图像)的UITableView。当用户点击特定的行项目时,它将转到detailViewController,它将所选行项目的文本和图像填充到下一个ViewController中。我正在使用prepareForSegue而不是didSelectRowAtIndexPath。titleForRow:indexPath.rowin:indexPath.section和imageForRow:...方法用于填充每个行项目的标题(cell.textLabel.text)和图像(cell.imageView.image)。我没有使用数据模型,因为这只是一个显示在detai

ios - 在自定义 Tableview Cell 中推送 ViewController

我正在使用UsingCustomizetablecell并在该单元格中有一个按钮操作,点击它应该会带我到另一个ViewController,我在按钮操作中使用此代码但它没有工作:PhotoViewController*photo=[[PhotoViewControlleralloc]initWithNibName:@"PhotoViewController"bundle:nil];[self.navigationControllerpushViewController:photoanimated:YES]; 最佳答案 得到解决方案:

ios - [cell addSubview :button] and [cell. contentview addsubview:button] 之间有什么区别

我在tableviewcell中有按钮。[celladdSubview:button]和[cell.contentviewaddsubview:button]有什么区别?因为当我在tableview中使用[celladdSubview:button]时,按钮功能工作正常但我在tableview中的界面搞砸了,在我ScrollView并返回tableview后按钮转到左侧单元格。另一方面,当我使用[cell.contentviewaddsubview:button]按钮功能不起作用并且没有任何内容保存到myarray。按钮代码:UIButton*button=(UIButton*)[ce

ios - UICollectionView scrollToItemAtIndexPath : and get fresh cell position

我想将CollectionView滚动到某个没有动画的屏幕外单元格,并在滚动后获取该单元格的位置。问题是CollectionView(视觉上)正确滚动,但单元格框架保持在屏幕外。这是我的代码:NSIndexPath*path=[fetchedResultsControllerindexPathForObject:objectInCollection];[collectionViewscrollToItemAtIndexPath:pathatScrollPosition:UICollectionViewScrollPositionCenteredVerticallyanimated:NO

ios - 在 UITableView 的自定义 Prototype Cell 中,UITextField 值替换为其他 Prototype Cell

我使用了一个UITableView并在其中使用了2个prototype单元格,现在在那些原型(prototype)单元格中,我使用了1个UITextField.现在,当我运行应用程序并在第一个原型(prototype)单元格中输入值时,我滚动UITableView,然后第一个原型(prototype)单元格的文本字段值变为最后一个原型(prototype)单元格的文本字段值。所以每次我向下滚动或向上滚动时它都会替换。有时它会变成空白。这是我的代码-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPa

iOS : What is the need of register cell before dequeuing in UITableView?

我经历了以下讨论:https://developer.apple.com/reference/uikit/uitableviewdatasource/1614861-tableviewhttps://developer.apple.com/reference/uikit/uitableview/1614937-registerhttps://developer.apple.com/reference/uikit/uitableview/1614891-dequeuereusablecellhttps://developer.apple.com/reference/uikit/uitab

javascript - 通过 UIWebView 在 JavaScript 中处理 Window.close - Obj C

我最近开始从事一个主要在UIWebView上运行的IOS项目。现在我的UIWebView是UIWebViewDelegate的委托(delegate),我遇到的是我的应用程序不响应window.close和其他JavaScript可能调用的window事件。现在我可以在我的shouldStartLoadWithRequest委托(delegate)方法中通过href获取一个新的HTTP请求。我希望知道是否有办法在我的IOS应用程序中监听window事件,例如window.close并检索目标。我想尽可能避免注入(inject)任何类型的JavaScript直接进入页面!有人愿意解释这是

ios - 如何在 ios 中单击时更改 tableView Cell 按钮图像

可能重复:howtochangetableViewCellbuttononclickiniphone我在表格View单元格中有一个按钮,其背景图像使用此函数设置。-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{UITableViewCell*cell=[tableViewdequeueReusableCellWithIdentifier:SectionsTableIdentifier];cell.textLabel.text=self.na