導航:首頁 > 操作系統 > android二維碼掃描豎屏

android二維碼掃描豎屏

發布時間:2022-11-22 18:50:18

android使用Zxing掃描二維碼改成豎屏後,後面的預覽畫面出現了拉伸,扭曲的情況,有沒有哪位大牛解決了,急求

更改CameraConfigurationManager.java文件

在 Log.d(TAG, "Screen resolution: " + screenResolution);這句之後增加
Point screenResolutionForCamera = new Point();
screenResolutionForCamera.x = screenResolution.x;
screenResolutionForCamera.y = screenResolution.y;
// preview size is always something like 480*320, other 320*480
if (screenResolution.x < screenResolution.y) {
screenResolutionForCamera.x = screenResolution.y;
screenResolutionForCamera.y = screenResolution.x;
}
再更改cameraResolution = getCameraResolution(parameters, screenResolution);為cameraResolution = getCameraResolution(parameters, screenResolutionForCamera);

代碼下載地址:http://download.csdn.net/detail/moonql70/5032148

㈡ 請問你門的Android與iphone手機,掃二維碼都怎樣掃

在蘋果手機自帶的應用里,包括相機,是沒有掃描二維碼這個功能的。但是可以採取其他手段如下:



1、QQ、微信、微博這一類軟體,它們就有掃描二維碼的功能,支持用手機上的相機直接掃描二維碼,也支持掃描你保存到手機相冊中的二維碼。

㈢ 如何使用Android相機掃描二維碼

用 qq或者微信自帶的掃一掃啊!瀏覽器在輸入地址的地方有個掃描標志點下就可以掃

㈣ Android端的二維碼(Zxing)掃描,要如何設定修改掃描框的大小,然後如何設定近距離聚焦

掃描框的大小就是修改CameraManager的四個常量

距離聚焦這個最好就不要去設置了,因為都是自己聚焦的

㈤ 二維碼掃描的時候鏡頭不對,豎屏的時候是橫屏,關了自動旋轉屏幕也不管用。求救

那是因為二維碼掃描軟體本身的原因,用芝麻客吧!我查查就是橫屏的,是不會轉的。

㈥ 如何使用android studio開發掃描二維碼程序

我們項目的前提是你已經將基本的運行環境及sdk都已經安裝好了,讀者可自行網路環境配置相關內容,本文不再贅述。右鍵點擊new-->Mole,Mole相當於新建了一個項目。如圖所示

選擇Android Application,點擊next

將My Mole 和app改成自己項目相應的名字,同時選擇支持的Android版本

這一步我們選擇Blank Activity,自己手動編寫登錄界面,而不依賴系統內置的Login Activity,一直點擊next,最後點擊finish就完成了項目的創建

在project下我們可以看到出現了我們剛才創建的login項目

展開res/layout,點擊打開activity_main.xml文件,在這個文件里我們將完成登錄界面的編寫

這是初始的主界面,還沒有經過我們編寫的界面,Android Studio有一個很強大的預覽功能,相當給力

我們將activity_main.xml的代碼替換成如下代碼:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:stretchColumns="0,3">
<TableRow>
<TextView />
<TextView
android:text="賬 號:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24px"
/>
<EditText
android:id="@+id/account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24px"
android:minWidth="220px"/>
<TextView />
</TableRow>
<TableRow android:layout_marginTop="20px">
<TextView />
<TextView
android:text="密 碼:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

/>
<EditText
android:id="@+id/pwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="220px"
android:textSize="24px"
android:inputType="textPassword"/>
<TextView />
</TableRow>
<TableRow android:layout_marginTop="20px">
<TextView />
<Button
android:id="@+id/login"
android:text="登錄"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/quit"
android:text="退出"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView />
</TableRow>
</TableLayout>

閱讀全文

與android二維碼掃描豎屏相關的資料

熱點內容
單片機程序存儲c 瀏覽:489
賽高網解壓密碼 瀏覽:775
雲伺服器安裝賺錢寶 瀏覽:107
pdf能修改內容嗎 瀏覽:386
貸款辦下來不給解壓 瀏覽:141
德國頂級編程思路 瀏覽:852
Flt單片機 瀏覽:476
ami和hdb3編解碼對比 瀏覽:665
純手工製作解壓視頻 瀏覽:119
雲職教APP為什麼收不到驗證碼 瀏覽:697
禮品發包網源碼 瀏覽:569
什麼app上能制圖 瀏覽:86
為什麼代理伺服器沒響應 瀏覽:562
小程序編譯提示 瀏覽:824
nameerrorpython 瀏覽:294
辭典pdf下載 瀏覽:801
遺傳演算法違反約束路徑數目 瀏覽:177
少年班中的古人演算法 瀏覽:931
什麼app一鍵p圖好看 瀏覽:573
查詢手機連上電腦的命令 瀏覽:850