熱門文章

練習:在兩條線中找出交叉點。

1.概念

兩個點會形成一條線,所以一個線段會有兩個點。在一個平面上畫兩條線,要如何知道這兩條線是否有交叉,且交叉點的座標又是多少?

首先要知道斜率,只有當這兩條線的斜率不同時,才會發生交叉。


photo by ToniVC

1.影格 vs 時間

在Flash中,當你設定"影格速率"為12fps時,表示每秒有12個影格,所以如果你寫一個移動物體的Actionscript如下:
mc.x += 10;




方法很簡單,在Eclipse中開啟一個新專案,在onCreat()中加入
ComponentName flashplayer = new ComponentName("com.htc.flash","com.htc.flash.FlashPlayer");
if(flashplayer != null){
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(flashplayer);
startActivity(intent);
}

原本的setContentView()要刪掉。



1.Widget觀念
widget就是在Home Screen顯示的元件,它只是View的一種,所以可以使用xml來設計layout。你可以設計一個在背景執行的Service,讓它定時去Update這個Widget。此外畫面的設計可以參考Dev手冊中的說明,尺寸的設計則有一個公式最小尺寸(dip) = (格子數 * 74) - 2。所謂的格子是指,Home Screen中劃分成4*4的格子,所以你的widget要佔滿幾個格子,就可以用這個公式去算出你的widget的尺寸,例如,要佔滿2格,就是(2*74)-2=146dip。

About me

我的相片
Tony
Taichung, Taiwan
檢視我的完整簡介

Recent Posts

Recent Comments

BloggerAds

Categories

Archive

Social

SiteInfo

Taiwan(台灣)

Google Ads