Drawing a circle in UIView is similar to drawing a border which is shown in the previous post.
iPhone – UIView with Border
Please follow the above example and modify the UIViewWithBorder.m as below. Continue reading iPhone – Draw a Circle in UIView
Drawing a circle in UIView is similar to drawing a border which is shown in the previous post.
iPhone – UIView with Border
Please follow the above example and modify the UIViewWithBorder.m as below. Continue reading iPhone – Draw a Circle in UIView
The border of the view could be drawn in the drawRect method in the view. Here is an example.
1. Create a UIView subclass (ex. UIViewWithBorder)
2. Construct the drawRect method In the UIViewWithBorder.m as follow Continue reading iPhone – UIView with Border
Recently start learning jQuery =)
When you are using jQuery with other Javascript libraries such as Prototype. There will be conflict on the $() function. There are 3 ways to bypass the conflict.
1. Only use jQuery() for the jQuery calls and revert the $() to Prototype
jQuery.noConflict();
// Use jQuery via jQuery(...)
jQuery(document).ready(function(){
jQuery("div").hide();
});
// Use Prototype with $(...), etc.
$('someid').hide();
Continue reading jQuery – Avoid Conflict with other Javascript Libraries
We can add an open URL action in iPhone application by the following line of code.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://ykyuen.wordpress.com"]];
please note that it will close the application and open the URL in browser.
And if you want to have a direct link to Apple appstore, you can get the URL from iTunes Link Maker.
Reference:
這是一個很有意思的命題﹕仇富。翻開近幾個月的印刷刊物,周刊日報都有這兩個字,彷彿一下子香港的富人都活不下去了,因為窮光蛋天天叼念追着他們來打,要分他們的家當,要把共產共妻的思想從解放前的中國大陸移植來香港抽新枝發嫩芽。可是到底哪個富人惹人仇讎卻沒有一個活生生例子。我的經驗和這稍微有點不同。九十年代初我從美國回來後聽到的第一個黑色笑話是這樣的﹕貧賤不能移,停頓半秒之後迸出最後一個字﹕民。那年那月是人人大包小包往美加英澳移民的日子,是的,那是跳船逃難的壯觀景象,是把沒法子東遷西移的窮人都丟給共產黨的日子。仇窮都來不及,哪有時間仇富,咪玩啦,香港人。
我是靠看電視過假日的典型香港人,過去三年唯一令我感慨萬千的電視節目是一個叫何喜華的頭髮斑白男子的訪問。他是社工,講的都是普羅大眾熟悉得不能再熟悉的低下層生活難熬的事實。不是說他噙着眼淚講香港貧窮問題我才感到百轉千迴,而是節目第二天我去灣仔一家上海店理髮,幾個師傅都六七十開外,如果家裏條件好的大概不用一把年紀站一整天替人剪那三千煩惱絲。我一面閉目養神,腦勺子上剪刀如飛,師傅扯大嗓門說到何喜華訪問。師傅說,抵佢死,成日示威有乜用?坐在斜對面的是另一對師傅和老主顧,半躺椅上修鬍子的是老人,和師傅正有一搭沒一搭講樓股講加拿大花園屋。我雖看不到他倆的神態,但光聽都聽得出那是充滿敬畏和傲慢的對話。 Continue reading 安裕周記 – 仇富定係仇窮?
MIA教育中心之高人
小學時有一個死黨,常出雙入對,一天,死黨的母親拖我們兩人在街上逛,遇見一位高人。高人指生得較為俊美的我說:「此子將來大有所為,恭喜恭 喜。」跟又指我的死黨:「此物甚濁,遠觀近玩,皆無是處,養大就算。」死黨母親礙于禮節,不便發作。高人走後,她強裝笑容連忙送我回家,跟便委屈地帶我死 党那濁物,鬱鬱中絕望地踏上歸途。
高人誤以為我是別人兒子,是一錯。再錯是把人家的獨生寶貝踩到地殼裏,永世不得翻身。最錯是把我捧得飄飄然喜不自勝,多少年來每每念及「此子將來大有所為」便甜絲絲的身不由己地眉開眼笑起來。 Continue reading 子華文集 – MIA教育中心 之 高人
It is very simple to implement touch events in iPhone application. The touch event is defined in the UIResponder which is the super class UIView. So for any UI controls, simply add the following piece of code to handle the touch events. Continue reading iPhone – Implement a Simple Touch Event
MIA教育中心之把自己留給自己
「整個海像要翻轉似的。」做海員的朋友憶述難忘經驗:「巨浪如地震中的高樓大廈四方八面塌下來,避得了合和中心避不了中環廣場。暴風像一頭瘋了的猛獸,無目的地噬咬,撕裂。天空雲浪海洋忽然之間凝成一團,忽然之間又會支離破碎……」朋友說到這裏,臉上流露出敬畏的神情。
我權威地幫他總結:「大自然的力量,是無可比擬的。在大自然面前,人能不渺小?」 Continue reading 子華文集 – MIA教育中心 之 把自己留給自己
MIA教育中心之去吧人生
那一個夜晚,與三個同學在宿舍裏談天說地。還開始了沒幾分鐘,便有人說:不去的是衰仔!跟另一個把挑戰再升一級:要去明天便去!一時之間,去去去,不去是契弟,一早便去。天未亮就出發,縮沙冇仔生諸如此類的壯膽口號,此起彼落,豪情蓋天。
第二天,在百分百裝備不足的情況之下,我們一行四人,半信半疑地走上了灰狗巴士,幸運地到達洛磯山脈邊緣,展開了為期四天的白癡遠足。
請留意:是為期四天,不是預期四天。事實上,我們抱難得瀟灑的態度,根本就沒有預什麼限期。楚留香出門,難道還要早機去晚機返過時補水不成?總之有感覺,磁場對,呀呀呀,千山我獨行,不必相送。 Continue reading 子華文集 – MIA教育 之 去吧人生
In Chrome, you can set the user agent to iPad such that the web server will return the view which is shown in iPad. Just add the user-agent parameter
1. Right click the Chrome shortcut on desktop and select property Continue reading Chrome – Set iPad as User Agent