嘗試使用帶有ImageButton的疊加層。 創建新的Android XML佈局文件,例如overlay.xml:
<?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="horizontal" >
<ImageButton
android:id="@+id/bTake"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_menu_snap" android:layout_gravity="bottom"/>
要建立覆蓋主代碼中使用LayoutInflater。
LayoutInflater inflater = LayoutInflater.from(getBaseContext());
View overlay = inflater.inflate(R.layout.overlay, null);
LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
addContentView(overlay, params);
shotBtn = (ImageButton) overlay.findViewById(R.id.bTake);
這種散漫的評論是不會讓你在任何地方:*「我嘗試過許多鏈接和資源,以瞭解如何能做到這一點,但得到的錯誤,如黑屏或只是按鈕或仿真器停止工作,當它進入頁面時給了我錯誤。「*閱讀這篇文章我不知道你做了什麼或結果是什麼。您需要一次嘗試**一件**,解釋您所做的事情,貼出源代碼,然後清楚描述問題,如果您想獲得幫助。 – Tim
thanks.basically我有兩個班級,第一個班級是一個簡單的「歡迎頁面」,帶有進入主頁面的頁面,當用戶單擊時,第二班班級將顯示一個表面視圖和一個捕獲圖片的按鈕。到目前爲止我所做的是我遵循「http://marakana.com/forums/android/examples/39.html」中的步驟,它一切正常,但現在的問題是我想使用OCR來提取文本從捕獲的圖片。我想着使用「TESSERACT」,並按照「http://www.itwizard.ro/interfacing-cc-libraries-via-jni-example-tesseract-163.html」中的步驟?任何建議? TA – user1406621