zoukankan      html  css  js  c++  java
  • iphone开发常见问题小集2 HA


    1.莫名碰到[[[Class alloc] init] autorelease] 调用时执行 -(id)initWithFrame:(CGRect)frame 

     原因:没有 重载init方法,就默认执行 重载的frame方法 

    2.UISerachBar 去除背景框

    for (UIView *subview in searchBar.subviews) {
       
    if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) {
           
    [subview removeFromSuperview];
           
    break;
       
    }

    } 

    3.响应键盘search事件{UITextFiled等同理}

    - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{

    } 

    4.NSSelectorFromString使用

    SEL blackSel = NSSelectorFromString(@"blackColor");

    if ([UIColor respondsToSelector: blackSel])

    self.view.backgroundColor  = [UIColor performSelector:blackSel]; 

    5.图片边拉伸

    - (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight

     6.能正确获取当前设备方向的方法{在ViewController里}

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 

  • 相关阅读:
    20150212-2015
    SM30维护视图添加按钮
    SAP保存操作记录CDHDR和CDPOS表
    20150123-慢慢
    20150124-轻轻
    维护 物料主数据 号码段
    ABAP DEMO-2018
    工具
    幽门螺杆菌资料收集
    MySQL 8 连接时出现 1251 和 2059 错误
  • 原文地址:https://www.cnblogs.com/halou/p/1992257.html
Copyright © 2011-2022 走看看