我尝试在listView中为书签功能创建一个带有3个标签,名称,书籍和章节的自定义UIView.现在我希望标签在tableView的单元格中位于不同的行中.如果您查看下面的代码,哪种方法最好,或者如何在自己的行上制作标签?我是Objective C和Iphone开发的新手.
结果在每个单元格的列表中应如下所示:
--------
name
book
chapter
--------
Run Code Online (Sandbox Code Playgroud)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"BookmarkCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
Bookmark *item = [self.items objectAtIndex:indexPath.row];
NSArray *chunks = [item.name componentsSeparatedByString: @","];
NSString *name;
NSString *book;
NSString *chapter;
if ([chunks count] > 0)
{
name = [chunks objectAtIndex:0];
if ([chunks count] > 1)
{
book = [chunks objectAtIndex:1];
if ([chunks count] > 2)
{ …Run Code Online (Sandbox Code Playgroud) 如何从https://github.com/ebutterfly/EBPurchase将本地cyrrency符号添加到Buy-Button
[buyButton setTitle:[@"Buy Game Levels Pack " stringByAppendingString:productPrice] forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud) 当我将视图从纵向旋转到横向或从横向旋转到纵向并且尝试通过键盘输入值时,我有一个视图,其中有2个文本字段,然后什么都不会发生.在大多数情况下,它会崩溃.
它适用于iOS 6,但在iOS 7中无法正常工作.
请建议/帮助.
提前致谢.
你如何在iOS中获得按钮的颜色?我设置了按钮的颜色.现在在另一个方法id喜欢得到它.有没有getBackgroundCOlour方法?我没有看到一个.我用以下代码设置颜色.
[self.skinColourButton setBackgroundColor:[UIColor greenColor]];
Run Code Online (Sandbox Code Playgroud) Apple表示最好使用URL来访问手机中存储的文件.但我找不到在URL上创建新文件的方法.有没有?或者我们必须使用路径创建文件并使用URL检索它们?
谢谢!