android版面手指放大縮小
發表人:
Ice
積分: 34
積分: 34
請問板大能夠提示一下兩隻手指就能放大縮小功能的程式碼是甚麼嗎??
是要用在平常看字方面的部分,不是照片
謝謝大大~
是要用在平常看字方面的部分,不是照片
謝謝大大~
發表人:
訪客
比較好做的方法是用WebView來包Text
因WevView已有縮放功能
因WevView已有縮放功能
發表人:
Ice
積分: 34
積分: 34
webview這個元件好像是針對瀏覽器的部分
我是想要.java搭配.xml的Activity顯示畫面
顯示的畫面就單純文字,但因為文字太小,所以要使用縮放功能
去做縮放的動作
不知道有沒有元件能實現??
不是瀏覽器喔~
謝謝指教!!
我是想要.java搭配.xml的Activity顯示畫面
顯示的畫面就單純文字,但因為文字太小,所以要使用縮放功能
去做縮放的動作
不知道有沒有元件能實現??
不是瀏覽器喔~
謝謝指教!!
發表人:
Ice
積分: 34
積分: 34
我自己有試著用WebView包Text
但無法啟動,可能是我設定的方式有問題,就在麻煩大大指教了,謝謝!!
[sea:javaCode]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<WebView android:id="@+id/webview"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</WebView>
</LinearLayout>
[/sea]
但無法啟動,可能是我設定的方式有問題,就在麻煩大大指教了,謝謝!!
[sea:javaCode]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<WebView android:id="@+id/webview"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</WebView>
</LinearLayout>
[/sea]
發表人:
Seachaos
積分: 2432
積分: 2432
Hi
你是只有要文字的縮放嗎?
webView.loadData("TEXT", "text/html", "utf-8");
可以試看看這個方法
你是只有要文字的縮放嗎?
webView.loadData("TEXT", "text/html", "utf-8");
可以試看看這個方法
發表人:
Ice
積分: 34
積分: 34
大大不知道有沒有更詳細的解釋,用了一整天,還是沒悟出來....
我就只是要單純的TextView元件,可以使用雙手指放大縮小,謝謝大大!!
我就只是要單純的TextView元件,可以使用雙手指放大縮小,謝謝大大!!
發表人:
Seachaos
積分: 2432
積分: 2432
另外一種就是在TextView的Touch事件上做判斷
再去控製Font Size
請參考Stackoverflow : http://stackoverflow.com/questions/5375817/android-pinch-zoom
不過你內文很多的話建議還是用WebView會比較方便
(一樣是顯示文字)
再去控製Font Size
請參考Stackoverflow : http://stackoverflow.com/questions/5375817/android-pinch-zoom
不過你內文很多的話建議還是用WebView會比較方便
(一樣是顯示文字)