Time of Update: 2016-08-01
標籤:方法一:iOS中有個叫端蓋(end cap)的概念,用來指定圖片中的哪一部分不用展開,上下左右不需要被展開的邊緣就稱為端蓋。 1 // use resizableImageWithCapInsets: and capInsets. 3 - (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight
Time of Update: 2016-08-03
標籤:擷取手機中的連絡人清單,需要用到系統給我們提供的架構:AddressBook.framework,1.匯入架構;2.簡曆模型和管理者:模型:.h#import <Foundation/Foundation.h>@interface Contact : NSObject@property (nonatomic, strong) NSString *name;@property (nonatomic, strong) NSString
Time of Update: 2016-08-03
標籤:在一個Activity中,多次調用startActivity()來啟動另一個Activity,要想只產生一個Activity執行個體,方法有兩種。 方法一:設定起動模式 一個Activity有四種啟動模式:standard, singleTop, singleTask, singleInstance。 standard: 標準模式,一調用startActivity()方法就會產生一個新的執行個體。 singleTop:
Time of Update: 2016-08-03
標籤:建立一個乾淨Spring MVC用Tomcat啟動之後一直顯示下面這個錯誤,網上找了很多方法也沒有解決問題,後面最終找到終極解決方案 錯誤資訊:SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener解決方案:1. 開啟工程屬性對話方塊,到Deployment Assembly頁面,點擊Add2. 選擇Jave Build
Time of Update: 2016-08-03
標籤:_textView = [[class alloc] init]; _textView.translatesAutoresizingMaskIntoConstraints = NO; _textView.font = [UIFont
Time of Update: 2016-08-03
標籤:iOS textField輸入金額的限制,小數點前9位,後面兩位,如果不加小數點,最大位元是9位,加上小數點,最大位元是12位,超出最大位元可刪除- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { // 判斷是否輸入內容,或者使用者點擊的是鍵盤的刪除按鈕
Time of Update: 2016-08-03
標籤:ADT(Android Development
Time of Update: 2016-08-01
標籤:別人寫的一個例子我記下了先,自己測試通過的
Time of Update: 2016-08-01
標籤:終極版package com.zhy.view;import android.annotation.SuppressLint;import android.content.Context;import android.graphics.Matrix;import android.graphics.RectF;import android.graphics.drawable.Drawable;import android.util.AttributeSet;import
Time of Update: 2016-08-02
標籤:1 常用表串連(inner join,left join,right join,full join,cross join)if object_id(N‘table1‘,N‘U‘) is not null drop table table1if object_id(N‘table2‘,N‘U‘) is not null drop table table2create table table1(id int,name varchar(20))insert into
Time of Update: 2016-08-01
標籤:1,自由的放大和縮小2.雙擊放大與縮小3.放大以後可以進行自由的移動4.處理與ViewPager之間的的事件衝突需要用到的知識點1.Matrix (圖片放大,縮小需要用到矩陣)2.ScaleGestureDetector(檢測使用者多指觸控時縮放的手勢)3.GestureDetector:檢測使用者雙擊時需要做的一些處理4.事件分發機制(當我們圖片放大時,我們的圖片是可以左右移動的,在ViewPager左右切換圖片,兩者會有衝突)。-----------------------------
Time of Update: 2016-08-01
標籤:第二步:給自訂控制項添加支援手指觸控縮放的功能:(支援手指觸控放大)因為涉及到手勢觸摸事件所以要實現OnScaleGestureListener,OnTouchListener這兩個介面。聲明成員變數: private ScaleGestureDetector mScaleGestureDetector;//捕獲使用者多指觸控縮放的比例在建構函式中初始化:mScaleGestureDetector = new ScaleGestureDetector(context,
Time of Update: 2016-08-01
標籤:第三課(第三步):支援以手指觸控的任意點為中心開始縮放關鍵區段是在縮放的時候不斷進行邊界檢測,防止放大後縮小後出現白邊:/** * 在縮放的時候進行邊界控制範圍位置控制 */private void checkBorderAndCenterWhenScale() {// TODO Auto-generated method stubRectF rect = getMatrixRectF();float deltaX = 0;float deltaY = 0;float width =
Time of Update: 2016-08-01
標籤:最近的一個項目中,涉及到圖片的本地儲存,剛開始,啪,報一個Bug,記錄下來:剛開始看了LogCat,以為是許可權問題:Manifest.xml中的許可權如下:也不缺少什麼使用權限設定,後來調試發現:這樣的檔案名稱在建立檔案時根本找不到路徑,系統不知道把檔案建立在哪,所以後來,把代碼改成了:這樣就好了。2016-08-01 Android 本地儲存圖片Exception ----open failed: EROFS (Read-only file system)
Time of Update: 2016-07-25
標籤:今天做聊天,領導說對方給我發一個圖片,我要儲存到本地,IOS的UIKit Framework提供了UIImageWriteToSavedPhotosAlbum方法對映像進行儲存,該方法會將image儲存至使用者的相簿中:上代碼:void UIImageWriteToSavedPhotosAlbum ( UIImage *image,
Time of Update: 2016-07-25
標籤: 1.布局xml檔案activity_main.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_
Time of Update: 2016-07-25
標籤: //從路徑中獲得完整的檔案名稱 (帶尾碼) 對從相簿中取出的圖片,視頻都有效。 NSString *fileName = [filePath lastPathComponent]; //獲得檔案名稱 (不帶尾碼) NSString *fileName1 = [filePath stringByDeletingPathExtension];
Time of Update: 2016-07-29
標籤:/** * 21000 App Store不能讀取你提供的JSON對象 * 21002 receipt-data域的資料有問題 * 21003 receipt無法通過驗證 * 21004 提供的shared secret不匹配你帳號中的shared secret * 21005 receipt伺服器當前不可用 * 21006 receipt合法,但是訂閱已到期。伺服器接收到這個狀態代碼時,receipt資料仍然會解碼並一起發送 * 21007 receipt是Sandbox
Time of Update: 2016-07-25
標籤: <input id="b1" type="button" value="同意(10)" disabled="disabled" /> <script type="text/javascript"> var t = 10; var aa = window.setInterval(‘a()‘, 1000); function a() { var b =
Time of Update: 2016-07-28
標籤:使用AVFoundation架構可以產生影片縮圖,用到的類:》》AVAsset: 用於擷取多媒體的相關資訊,如多媒體的畫面和聲音等。》》AVURLAsset: AVAsset的子類,用於根據NSURL產生AVAsset對象》》AVAssetImageGenerator: 用於截取視頻指定幀的動畫一般步驟:1、根據視頻的URLchuang見AVURLAsset對象2、根據AVURLAsset對象建立AVAssetImageGenerator對象3、調用AVAssetImageGen