Time of Update: 2018-12-04
看了android的原始碼和資源檔,終於明白如何去修改設定Dialog和Activity的進入和退出效果了。設定Dialog首先通過getWindow()方法擷取它的視窗,然後通過getAttributes()方法獲得window的WindowManager.LayoutParams lp, lp有個公用屬性windowAnimations,
Time of Update: 2018-12-04
一、Sting類是對字串事物的描述,該類定義了專門用於操作字串的方法。它是一個final類,不能被繼承。String s1="java"; Strings2="java" String類在java中採用了享元設計模式,s1和s2兩個引用變數指向了同一個記憶體位址。s1==s2 為true.String s=new String("java") ;建立了兩個對象,"java"是一個匿名對象,new關鍵字在對記憶體又建立一個對象。二、String類常用方法列舉1.擷取。1.1
Time of Update: 2018-12-04
Android的view組件顯示主要經過mesure, layout和draw這三個過程。在mesure階段裡調用mesure(int widthSpec, int heightSpec)方法,這個方法是final不能被重寫,在這個過程裡會調用onMesure(int widthSpec, int heightSpec)方法。當組件設定好大小後,調用final layout(int l, int t, int r, int
Time of Update: 2018-12-04
/*** * 建立通知欄 */ RemoteViews contentView; public void createNotification() { notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notification = new Notification();
Time of Update: 2018-12-04
<pre class="plain" name="code">/* (程式頭部注釋開始) * 程式的著作權和版本聲明部分 * Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved. * 檔案名稱: C++第十周【任務2】 * 作 者: 鮑增凱 * 完成日期: 2012 年 5 月
Time of Update: 2018-12-04
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/layout"android:layout_width="fill_parent" android:layout_height="fill_parent"><ListView
Time of Update: 2018-12-04
利用BroadcastReceiver實現搶購倒計時,當然你也可以用Thread+Handler來完成。實際應用中我們倒計時的時間是從服務端擷取的。運行效果:布局檔案:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"
Time of Update: 2018-12-04
<pre class="plain" name="code">/* (程式頭部注釋開始) * 程式的著作權和版本聲明部分 * Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved. * 檔案名稱: C++第十周【任務3】 * 作 者: 鮑增凱 * 完成日期: 2012 年 5 月 14
Time of Update: 2018-12-04
在通過xml檔案構造view組件的時候,往往都要使用到AttributeSet和defStyle這個兩個參數,例如Button組件的構造方法Button(Contextctx, AttributeSet attrs, intdefStyle)中,ctx會調用obtainStyledAttributes( AttributeSet set, int[] attrs, intdefStyleAttr,
Time of Update: 2018-12-04
echo、@、call、pause、rem 是批次檔最常用的幾個命令,我們就從他們開始學起。 echo 表示顯示此命令後的字元 echo off 表示在此語句後所有啟動並執行命令都不顯示命令列本身 @ 與echo off相象,但它是加在其它命令列的最前面,表示運行時不顯示命令列本身。 call 調用另一條批次檔(如果直接調用別的批次檔 ,執行完那條檔案後將無法執行當前檔案後續命令) pause 運行此句會暫停,顯示Press any key to
Time of Update: 2018-12-04
今天終於切切實實弄明白matrix那幾個方法的使用了,比如preTranslate, setTranslate, postTranslate這些。以前對它們都是一知半解,以為這幾個方法沒什麼區別,其實還是有很大不同的,最緊要是這幾個方法的調用順序對座標變換的影響。抽象的說pre方法是向前"生長", post方法是向後"生長",具體拿個例子來說,比如一個matrix調用了下列一系列的方法: matrix.preScale(0.5f, 1);
Time of Update: 2018-12-04
在布局檔案中:<RatingBar style="@style/myRatingBar" //使用樣式 android:layout_marginLeft="10dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/rbar"></RatingBar>在values檔案夾下的 styles.xml檔案夾中<?xml
Time of Update: 2018-12-04
很多時候都搞不清window和view之間的關係,今天重新看了一下api和原始碼,終於又有多點認識了。其實window沒有繼承其他類,它是object的直接子類,這和iPhone中window和view的關係不同。window是抽象類別,由系統內部實現,我們通常執行個體化不了。window其實是對view的封裝,提供更多的特性,比如標題、進度條等,可通過requestFeature(int id)方法進行設定。 每個activity都包含一個window,
Time of Update: 2018-12-04
/* (程式頭部注釋開始)* 程式的著作權和版本聲明部分* Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved.* 檔案名稱: * 作 者:鮑增凱 * 完成日期: 2012 年 5 月 7 日* 版 本 號:01.#include<iostream.h> 02.
Time of Update: 2018-12-04
/* (程式頭部注釋開始)* 程式的著作權和版本聲明部分* Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved.* 檔案名稱: * 作 者: 鮑增凱 * 完成日期: 2012 年 5 月 7 日* 版 本 號:01.#include <iostream> 02.using
Time of Update: 2018-12-04
<pre class="plain" name="code">/* (程式頭部注釋開始) * 程式的著作權和版本聲明部分 * Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved. * 檔案名稱: C++第十周【任務1】 * 作 者:鮑增凱 * 完成日期: 2012 年 5 月 14日* 版
Time of Update: 2018-12-04
我們知道View在螢幕上顯示出來要先經過measure和layout. 在調用onMeasure(int widthSpec, int heightSpec)方法時,要涉及到MeasureSpec的使用,MeasureSpec有3種模式分別是UNSPECIFIED, EXACTLY和AT_MOST, 那麼這些模式和我們平時設定的layout參數fill_parent,
Time of Update: 2018-12-04
01.#include<iostream> 02.using namespace std; 03.class C 04.{ 05.private: 06. int x; 07.public: 08. C(int x){this->x = x;} 09. int getX(){return x;} 10.}; 11. 12.void main() 13.{ 14. C c(5); //將原程式中 const 去掉 1
Time of Update: 2018-12-04
1,切換到root 使用者2,點擊VMware的 VM選項,點settings,在hardware選項點CD/DVD,在USe ISO image file裡 選擇vmware安裝目錄的,我的是在C:\Program Files\VMware\VMware Workstation\linux.iso,這個。so檔案就相當於是vmware TOOls的安裝檔案3,設定完畢後,進到終端,root下。點 uname -r 查看核心版本, rpm -q kernel-devel
Time of Update: 2018-12-04
03.#include<iostream> 04.using namespace std; 05.class A 06.{ 07.private: 08. int a; 09.public: 10. A(){a = 0;} 11. A(int aa):a(aa){} //定義建構函式,用參數aa初始化資料成員a 12.}; 13. 14.void main() 15.{ 16. A *p;