導航:首頁 > 操作系統 > 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二維碼掃描豎屏相關的資料

熱點內容
java文件行讀寫 瀏覽:542
影城網上售票系統源碼 瀏覽:632
防疫就是命令歌曲 瀏覽:202
滴滴號碼加密怎麼解除 瀏覽:844
模具編程的職責 瀏覽:943
華為ssh改加密演算法 瀏覽:149
文件夾空白合同 瀏覽:763
pythonwebpy開發 瀏覽:671
不是c編譯器的有 瀏覽:662
win10壓縮包下載 瀏覽:905
逆戰手機app怎麼樣 瀏覽:948
自嗨自我解壓圖片 瀏覽:397
電子書導入kindle哪個文件夾 瀏覽:420
pythontcpserver性能 瀏覽:546
linux文件夾改名 瀏覽:566
單片機開發板是什麼 瀏覽:853
阿里雲伺服器不能截屏 瀏覽:868
如何自己製作聯想伺服器 瀏覽:845
停車場規劃演算法 瀏覽:925
深蹲PDF 瀏覽:908