小编Piy*_*bey的帖子

如何在自己的行上制作每个customLabel?

我尝试在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)

listview objective-c uiview uilabel ios

1
推荐指数
1
解决办法
128
查看次数

如何在应用购买中添加本地货币符号 - ios

如何从https://github.com/ebutterfly/EBPurchase将本地cyrrency符号添加到Buy-Button

[buyButton setTitle:[@"Buy Game Levels Pack " stringByAppendingString:productPrice] forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)

iphone in-app-purchase ios

1
推荐指数
1
解决办法
1387
查看次数

U7extfield shouldChangeCharactersInRange在iOS7中将视图从纵向旋转到横向或反之亦然

当我将视图从纵向旋转到横向或从横向旋转到纵向并且尝试通过键盘输入值时,我有一个视图,其中有2个文本字段,然后什么都不会发生.在大多数情况下,它会崩溃.

它适用于iOS 6,但在iOS 7中无法正常工作.

请建议/帮助.

提前致谢.

uitextfield ipad uiinterfaceorientation ios ios7

1
推荐指数
1
解决办法
749
查看次数

在iOS中获取按钮的颜色

你如何在iOS中获得按钮的颜色?我设置了按钮的颜色.现在在另一个方法id喜欢得到它.有没有getBackgroundCOlour方法?我没有看到一个.我用以下代码设置颜色.

[self.skinColourButton setBackgroundColor:[UIColor greenColor]];
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uibutton ios4 ios

0
推荐指数
1
解决办法
1164
查看次数

使用URL而不是Paths的iOS NSFileManager Store文件在Document目录中?

Apple表示最好使用URL来访问手机中存储的文件.但我找不到在URL上创建新文件的方法.有没有?或者我们必须使用路径创建文件并使用URL检索它们?

谢谢!

iphone objective-c nsfilemanager ios

0
推荐指数
1
解决办法
856
查看次数