Time of Update: 2015-08-12
標籤:apidemo display actionbar 常量運算 options 這個demo示範了actionbar的各種配置樣式。 activity_main.xml<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
Time of Update: 2015-08-12
標籤:國際化 android (1)字串的國際化在res下寫兩個values注意:命名方式都是固定的一個中文版:values-zh一個英文版:values-en但是<string name 要寫成一樣的,這樣會根據系統語言自適應切換對應的語言綁定國家:values-en-rUS綁定美國values-zh-rCN綁定中國
Time of Update: 2015-08-12
標籤:裝置的相容性 聲明:本文由Gordon翻譯發佈於www.dlvoice.com歡迎轉載,但請保留此聲明原文地址:http://developer.android.com/guide/practices/compatibility.html
Time of Update: 2015-08-12
標籤:applicationApplication對象是javax.servlet.ServletContext介面的執行個體化對象,常用的方法有:NO方法描述1Public String getRealPath(String path)得到虛擬目錄的絕對路徑2Public String getContextPath()得到當前的虛擬路徑名稱3Public Enumeration
Time of Update: 2015-08-12
標籤:當android應用程式運行時,一個主線程被建立(也稱作UI線程),此線程主要負責處理UI相關的事件,由於Android採用UI單執行緒模式,所以只能在主線程中對UI元素進行操作,如果在非UI線程直接對UI進行了操作,則會報錯,另外,對於運算量較大的操作和IO操作,我們需要新開線程來處理這些工作,以免阻塞UI線程,子線程與主線程之間是怎樣進行通訊的呢?此時就要採用訊息迴圈機制(Looper)與Handler進行處理。一、基本概念Looper:每一個線程都可以產生一個Looper,用來管理線
Time of Update: 2015-08-11
標籤:項目地址:點擊開啟,原文參考地址:點擊開啟1. 將mpandroidchartlibrary-2-0-8.jar包copy到項目的libs中2. 定義xml檔案<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
Time of Update: 2015-08-12
標籤:其實實現這個效果很簡單,只是為這個根布局加了一個動畫;即:1:為根布局設定一個id;2:activity 執行個體化布局中的id,並綁定動畫;3:設定震動效果,最好震動的時間長度和抖動的時間長度同步起來。下面來看一看代碼:1:xml檔案:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
Time of Update: 2015-08-11
標籤:Url編碼 當url地址中包含有中文字元或其他非標準的url字元時,需要對該url地址進行編碼,否則直接使用的話,會報錯。NSString提供編碼和解碼方法: 編碼:stringByAddingPercentEscapesUsingEncoding  
Time of Update: 2015-08-11
標籤:今天用Xcode 6.1 上傳應用到市場,出現了如下問題:Error ITMS-9000: "Invalid image path - No image found at the path referenced under key CFBundleIcons
Time of Update: 2015-08-11
標籤:ios swift 網路編程 我在上一篇部落格《iOS項目開發實戰——iOS網路編程擷取網頁Html原始碼》中講述了如何擷取一個網頁的HTML原始碼,可以滿足一定的需求。但是由於特殊原因,我們想擷取的是一個網頁的位元據,那麼應該怎麼辦呢?
Time of Update: 2015-08-12
標籤:ios 測試 單元測試 ghunit cocoapod 1、同樣建立一個測試的工程,2、通過cocoaPod來下載GHUnit架構,或者到github上下載,因為這個架構是開源的第三方架構。同時添加QuartCore.framework。3、在項目的Build Setting 中國搜尋other linker Flags,
Time of Update: 2015-08-12
標籤:arguments, caller, callee, this都是用在函式(function)內的特殊內定物件。而apply()及call()則是用來呼叫函式的不同作法。arguments可用來取得function傳入的實際變數Array。這個變數特別適合用在撰寫”多形”(Polymorphism)函式上,即可以根據不同的傳入參數做不同的處理。範例一 – 加總函式function sum() { var total = 0; for(
Time of Update: 2015-08-12
標籤:Fragment在Android3.0開始提供,並且在相容包中也提供了Fragment特性的支援。Fragment的推出讓我們編寫和系統管理使用者介面更快捷更方便了。 但當我們執行個體化自訂Fragment時,為什麼官方推薦Fragment.setArguments(Bundle
Time of Update: 2015-08-12
標籤:1.打電話- (IBAction)callPhone1:(id)sender { NSURL *url = [NSURL URLWithString:@"tel://18500441739"]; [[UIApplication sharedApplication] openURL:url];}- (IBAction)callPhone2:(id)sender { NSURL *url = [NSURL URLWithString:@"telprompt://1850044
Time of Update: 2015-08-12
標籤: package com.whoop.mobile.trace.util;import android.content.Context;import android.content.res.Resources;import android.view.Gravity;import android.widget.Toast;public class ToastUtil { private Context mContext;
Time of Update: 2015-08-12
標籤:打包時報如下錯誤:<ignore_js_op>Export aborted because fatal lint errors were found. These are listed in the Lint View. Either fix these before running Export again,or turn off"Run full error check when exporting app" in the Android > Lint Error
Time of Update: 2015-08-12
標籤:方法一:在 xml 檔案中設定文本編輯框屬性作字元數限制如:android:maxLength="10" 即限制最大輸入字元個數為10 方法二:在代碼中使用InputFilter 進行過濾//editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(20)}); 即限定最大輸入字元數為20 [java] view
Time of Update: 2015-08-11
標籤:android 自訂view 自訂View實現登入註冊頁面的EditText一鍵清空功能,效果如下: 輸入框輸入文字後自動出現一鍵清空鍵,輸入框文字為空白時,一鍵清空鍵隱藏,下面我們看一下如何通過自訂View實現這一效果。 看一下DeletableEditText.java:package com.example.testview;import android.content.Context;import
Time of Update: 2015-08-11
標籤:package com.example.firstpg.firstpg;import android.support.v7.app.ActionBarActivity;import android.os.Bundle;import android.util.Log;import android.view.Menu;import android.view.MenuItem;import android.view.Window;import
Time of Update: 2015-08-11
標籤:轉載地址:http://jingyan.baidu.com/article/bea41d439bd6d5b4c41be659.html當我們開發android應用需要用到android-support-v7-appcompat.jar這個庫時(比方說要在2.2版本上使用actionbar和fragment),在項目中匯入v4和v7這兩個庫之後,新手往往會遇到一些問題。在這裡,總結一下可能遇到的問題,以及解決的方法。工具/原料需要兩個庫:android-support-v4.jar,andr