Time of Update: 2016-08-14
標籤:package liu.myrecyleviewchoosephoto.view;import android.content.Context;import android.util.AttributeSet;import android.widget.RelativeLayout;/** * 正方形的RelativeLayout * Created by 劉楠 on 2016/8/13 0013.16:07 */public class SquareRelativeLayout
Time of Update: 2016-08-14
標籤:正好需要,在網上找了好久,記錄一下 1 function isMobile(){ 2 $useragent=isset($_SERVER[‘HTTP_USER_AGENT‘]) ? $_SERVER[‘HTTP_USER_AGENT‘] : ‘‘; 3 $useragent_commentsblock=preg_match(‘|\(.*?\)|‘,$useragent,$matches)>0?$matches[0]:‘‘; 4
Time of Update: 2016-08-14
標籤://判斷手機型號 var u = navigator.userAgent; var device =""; //當前裝置資訊 if (u.indexOf(‘Android‘) > -1 || u.indexOf(‘Linux‘) > -1) {//安卓手機 device = "Android"; } else if (u.indexOf(‘iPhone‘) > -1) {//蘋果手機 d = "iPhone"; } else if (u.indexOf(‘
Time of Update: 2016-08-14
標籤:1.啟動載入完核心2.執行init進程 ----> 裝置初始化工作 a1. 讀取inic.rc a2. 啟動Zygote進程 ----> 該進程是所有進程的孵化器 b1. 初始化dalvik虛擬機器 b2.
Time of Update: 2016-08-13
標籤:一、簡介可以讓物體迅速衝到某個位置(捕捉位置),捕捉到位置之後會帶有一定的震動UISnapBehavior的初始化 - (instancetype)initWithItem:(id <UIDynamicItem>)item snapToPoint:(CGPoint)point; UISnapBehavior常見屬性 @property (nonatomic, assign) CGFloat damping; 用於減幅、減震(取值範圍是0.0 ~ 1.0,值越大,
Time of Update: 2016-08-13
標籤:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"
Time of Update: 2016-08-13
標籤:1,建立UIView 的SubClass 命名為MyView 2, new一個名為MyView的xibp13,配置xib的屬性p24,為View 添加背景色,添加一個按鈕並定製按鈕約束,這裡我添加的約束為垂直置中,Button與View等寬,Button左邊起點位置為0。p35,設定xib中的File’s owner =
Time of Update: 2016-08-13
標籤:px:css pixels 邏輯像素,瀏覽器使用的抽象單位dp(Android),pt(iOS):device independent pixels 裝置無關像素,邏輯像素dpr:devicePixelRatio 裝置像素縮放比 DPi:印表機每英寸可以噴的墨汁點(印刷行業)PPI:螢幕每英寸的像素數量,即單位英寸內的像素密度目前,在電腦顯示裝置參數描述上,二者意思表達的是一樣的。 計算公式:以 iPhone5 為例,ppi = √(11362 +
Time of Update: 2016-08-13
標籤:iOS開發UI篇—CAlayer(自訂layer)一、第一種方式1.簡單說明以前想要在view中畫東西,需要自訂view,建立一個類與之關聯,讓這個類繼承自UIView,然後重寫它的DrawRect:方法,然後在該方法中畫圖。繪製圖形的步驟:(1)擷取上下文(2)繪製圖形(3)渲染圖形 如果在layer上畫東西,與上面的過程類似。程式碼範例:建立一個類,讓該類繼承自CALayerYYMylayer.m檔案 1 // 2 // YYMylayer.m 3 // 05
Time of Update: 2016-08-13
標籤: 先 點擊+號就去選擇圖片實際上這個添加本身就是一個ListView或者 RecyclerView 只是布局有些特殊item<?xml version="1.0" encoding="utf-8"?><liu.myrecyleviewchoosephoto.view.SquareRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
Time of Update: 2016-08-13
標籤:adapterapientityhandleruiuntilwidgetappContent.java*************************************圖片:drawable:存放各種位元影像檔案,(.png,.jpg,.9png,.gif等)除此之外可能是一些其他的drawable類型的XML檔案mipmap-hdpi:高解析度,一般我們把圖片丟這裡mipmap-mdpi:中等解析度,很少,除非相容的的手機很舊mipmap-xhdpi:超高解析度,手機螢幕材質越來
Time of Update: 2016-08-13
標籤:// 排版時,注意logical coordinate space和device coordinate space的區別,注意frame和bounds的區別! - (void)loadView{ // ... // 計算Custom Content View的Rect if (!_supportFullScreen) {
Time of Update: 2016-08-13
標籤:開發自訂控制項的步驟:1、瞭解View的工作原理 2、 編寫繼承自View的子類3、 為自訂View類增加屬性 4、 繪製控制項 5、 響應使用者訊息 6
Time of Update: 2016-08-13
標籤:首先建立一個空的xib檔案:然後在xib中自訂視圖(添加自己想要的其它視圖):要寫好約束, 建立一個繼承uiview的類和他關聯,然後就可以調用了.- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. NSArray *nibContents = [[NSBundle mainBundle]
Time of Update: 2016-08-13
標籤:http://android-mirror.bugly.qq.com:8080/include/usage.html Windows A. 開啟Android SDK Manager B. 設定代理 請務必選擇: Force https://... sources to be fetched using http://... C.
Time of Update: 2016-08-12
標籤:一、字串字串是String類型的資料,用雙引號""包住文字內容 let website = "http://www.wendingding.com"1.字串的常見操作(1)用加號 + 做字串拼接let scheme = "http://"let path = “www.wendingding.com”let website = scheme + path//
Time of Update: 2016-08-12
標籤:菜鳥團購 二維碼 拉手網 第三方 團購 最近在學著做一個團購APP,仿照的是拉手網App,下面是運行,歡迎加入QQ群一起探討交流。群號:542211401主要功能有:引導介面,城市定位和選擇,首頁,周邊,商品列表,商品詳情,訂單支付,二維碼商品掃描,地圖,第三方帳號登入,商品分享,緩衝清理等所用技術:EventBus,Rx
Time of Update: 2016-08-12
標籤:數列 //百萬數內 看數列離散點 根據 x 找接近 的數列數#include<bits/stdc++.h>using namespace std;int funsteap(int xx) { int ret=0; //迴圈
Time of Update: 2016-08-12
標籤: 好久沒有動部落格了哈~先寫一個比較基礎的東西吧~其實呢~在java裡面也有提到,但是使用更多的是在安卓裡面的控制項。 那麼現在來寫第一個回調: 第一種是介面之間~其實也算是吧~比較特別~這種是activity與activity之間比較常見的,就不特別說明:@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(
Time of Update: 2016-08-12
標籤:iOS下JS與原生OC互相調用引言一直聽說WKWebView比UIWebView強大許多,可是一直沒有使用到,今天花了點時間看寫了個例子,對其API的使用有所瞭解,為了日後能少走彎路,也為了讓大家更容易學習上手,這裡寫下這篇文章來記錄如何使用以及需要注意的地方。溫馨提示:本人在學習使用過程中,確實有此體會,WKWebView的確比UIWebView強大很多,與JS互動的能力顯示增強,在載入速度上有所提升。WKWebView新特性效能、穩定性、功能大幅度提升允許JavaScript的Nitr