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

熱點內容
二手開利螺桿壓縮機 瀏覽:309
有php基礎學java要多久 瀏覽:300
程序員稅後工資多少可以跳槽 瀏覽:172
個別網站無法解析伺服器的dns地址 瀏覽:972
安卓手機如何打開rmb文件 瀏覽:215
新生兒app叫什麼 瀏覽:65
斗魚加密怎麼弄 瀏覽:761
為什麼會加密不可上網 瀏覽:531
步步高手機編譯時間啥意思 瀏覽:396
程序員復盤app 瀏覽:160
pdf確定 瀏覽:537
php連接mysql埠號 瀏覽:1001
id3演算法在進行某個節點劃分時 瀏覽:407
麥塊伺服器如何登錄正版 瀏覽:687
中國民俗學pdf 瀏覽:387
程序員如何做人力資源 瀏覽:658
p單片機數字電壓表項目設計報告 瀏覽:450
做一個單片機系統要經過哪些步驟 瀏覽:153
阿里雲php版本升級 瀏覽:355
pdf轉換word綠色 瀏覽:359