小编art*_*ysx的帖子

UICollectionView estimatedItemSize - 最后一个单元格未对齐

我想在单元格中使用estimatedItemSize和preferredLayoutAttributesFittingAttributes制作一个通常的horizo​​ntalScrolling flowLayout UICollectionView.但最后一个细胞有问题.知道问题出在哪里? 项目本身

在此输入图像描述

@implementation RowCollectionView

- (instancetype) initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout
{
    if (self = [super initWithFrame:frame collectionViewLayout:layout])
    {
        [self configureRowCollectionView];
    }

    return self;
}

- (void) awakeFromNib
{
    [super awakeFromNib];

    [self configureRowCollectionView];
}

- (void) configureRowCollectionView
{
    self.backgroundColor = [UIColor lightGrayColor];

    self.dataSource = self;
    self.delegate = self;

    // Horizontal Direction
    UICollectionViewFlowLayout *flowLayout = (UICollectionViewFlowLayout *) self.collectionViewLayout;
    flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;

    // Estimated Item Size
    flowLayout.estimatedItemSize = CGSizeMake(self.bounds.size.height, self.bounds.size.height);


    [self registerClass:[RowCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([RowCollectionViewCell class])];
}

- (NSInteger) collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{ …
Run Code Online (Sandbox Code Playgroud)

objective-c ios uicollectionview uicollectionviewcell

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

反编译Obj C框架

我想反编译iOS Twitter框架,如果我从xcode的模拟器中获取twitterd文件,该模拟器预编译为在x86(?)上运行,而不是ARM.至于工具,我使用http://code.google.com/p/i386codedump/ 说明:

Usage: code-dump [options] <mach-o-file> where options are:
    -a             show instance variable offsets
    -A             show implementation addresses
    --arch <arch>  choose a specific architecture from a universal binary (ppc, i386, etc.)
    -C <regex>     only display classes matching regular expression
    -H             generate header files in current directory, or directory specified with -o
    -I             sort classes, categories, and protocols by inheritance (overrides -s)
    -o <dir>       output directory used for -H
    -r             recursively expand frameworks and fixed VM shared libraries
    -s …
Run Code Online (Sandbox Code Playgroud)

objective-c ios-frameworks

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

苹果手机.更改IB中的状态栏颜色不起作用

我知道,这听起来很愚蠢,但改变IB中的状态栏颜色,并没有改变任何东西.它总是保持灰色.我可以将代码改为黑色(有效),但在第一次启动时我仍然有这个灰色条.XCode是4.2 beta,现在无法下载新的.

有什么想法吗?

iphone statusbar uistatusbar

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

从UIResponderStandardEditActions执行复制/剪切

这些是UIMenuController非标准行动宣告http://developer.apple.com/library/ios/#documentation/uikit/reference/UIResponderStandardEditActions_Protocol/UIResponderStandardEditActions.html

如何手动执行这些方法,例如从其他UIMenuItem或其他任何方法?我找不到合适的选择器:(

  1. [self cut:sender];
  2. [UIResponder cut:sender];
  3. [[UIMenuController sharedMenuController] cut:sender];
    • (void)cut:(id)sender {[super cut:sender];}

到目前为止,这些不起作用,选择器未找到.

iphone uimenucontroller uiresponder

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