Bits of knowledge

来源:http://www.cnblogs.com/GhostKZShadow/archive/2016/01/06/5105423.html
-Advertisement-
Play Games

如何獲取當前設備的系統版本!!![[[UIDevice currentDevice] systemVersion] floatValue]獲取App版本NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; // ...


如何獲取當前設備的系統版本!!! 
[[[UIDevice currentDevice] systemVersion] floatValue] 
獲取App版本
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 
  // app名稱
    //NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
    
    // app build版本
    //NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion"];
    
    // app版本
    NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];

如何更改導航控制器push動畫時間?   
 A控制器push到B控制器,push動畫過渡時間大約為0.3秒。希望改成0.7秒! pop出來也改成0.7秒!請問該如何實現? 
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if (self.viewControllers.count > 0) {

        viewController.hidesBottomBarWhenPushed = YES;
        CATransition *animation = [CATransition animation];
        animation.duration = 0.5f;
        animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
        animation.type = kCATransitionPush;
        animation.subtype = kCATransitionFromRight;
        [self.navigationController.view.layer addAnimation:animation forKey:nil];
        [super pushViewController:viewController animated:NO];
        return;
    }
    [super pushViewController:viewController animated:YES];
}

iOS界面設置豎屏,個別界面強制橫屏   
- (BOOL)shouldAutorotate 當前viewcontroller是否支持轉屏


- (NSUInteger)supportedInterfaceOrientations;當前viewcontroller支持哪些轉屏方向   -(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation當前viewcontroller預設的屏幕方向  

 

 

#import <UIKit/UIKit.h>

@interface CustomNavigationController : UINavigationController

@property(nonatomic)NSUInteger orietation; 

 

 

#import "CustomNavigationController.h"

@interface CustomNavigationController ()

@end

@implementation CustomNavigationController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {

    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//當前viewcontroller是否支持轉屏
-(BOOL)shouldAutorotate
{
    return NO;
    
}

//當前viewcontroller支持哪些轉屏方向
-(NSUInteger)supportedInterfaceOrientations{
    //return UIInterfaceOrientationMaskLandscapeRight;
    return self.orietation;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != self.orietation);

 

iOS推崇使用png格式的 說這樣不會失幀
imageWithContentsOfFile這個方法?跟imagewithname的區別嗎
imagewithname會使用系統緩存,對重覆載入的圖片速度會快。效果好 
imageWithContentsOfFile不會緩存


小圖 用 imageName  大圖 還有 做動畫的圖片 使用imageWithContentsOfFile
您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • >>>> 為什麼需要規範的資料庫設計在實際的項目開發中,如果系統的數據存儲量較大,設計的表比較多,表和表之間的關係比較複雜,就需要首先考慮規範的資料庫設計,然後進行創建庫,創建表的工作. 如果設計不當,會存在數據操作異常,修改複雜,數據冗餘等問題,程式性能會受到影響,通過進行規範化的資料庫設計,可....
  • Kotlin開發語言文檔,第一章:入門
  • 知識點: 1)UINavigationController 2)UINavigationBar 3)UINavigationItem 4)UIToolBar======================================================一、UINavigationCont...
  • /* ViewController.h 文件 */#import @interface ViewController : UIViewController@end/* ViewController.m文件 */#import "ViewController.h"@inte...
  • 1.目錄建立連接 主動調用獲取AccessToken 回調模式管理多媒體文件 上傳媒體文件 獲取媒體文件發送消息 發送介面說明 消息類型及數據格式 text消息 image消息 voice消息 video消息 file消息辦公消息免登服務 使用標準OAUTH2.0 HTTP ...
  • 企業煩惱一:找人的痛苦 調查數據顯示,在一個規模500人以上的企業中,找到跨部門的陌生員工,需要經過3步,高管,人事,前臺。 復興集團是上海市最大的民營企業,管理資產超過了3000億人民幣,集團總部有1000多人,而其下屬企業規模都能達到數千人,並且遍佈在全國全球。 復星集團IT總監趙沛表示,...
  • 普通用戶(個人)團隊企業1.免費額度為每月通話100分鐘、每天發DING 5次。1. 每月通話300分鐘,每天發DING 10次。2. 群組最多可達1500人1. 該公司所有註冊員工的通話分鐘均會上升至1000分鐘/月,每天DING的次數也會增加到30次。2. 群組最多可達1500人3. ...
  • 1.對於過多的控制項,功能類似,數量又多的,可以用include方法。在實現應用中,可以把控制項放入List集合中。private void initView() { // TODO Auto-generated method stub pwd1 = (EditText) findViewByI...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...