카메라 미리보기에 화면의 일부를 채우는 방법이 있는지 궁금 해서요. 하단에는 나중에 텍스트를 추가 할 수있는 텍스트보기 상자가 있습니다. 코드를 계속 진행하기 전에 팀에서 아직이 기능을 사용할 수 있는지 평가 중이므로 아직 코드가 없습니다.Camera Preview와 TextView를 같은 화면에 둘 수 있습니까?
편집 2 : 이제 마침내 안드로이드 : 중력을 가지고 놀고 나면 화면의 텍스트를 볼 수있게되었습니다. 그러나 TextView는 항상 화면 상단에 나타나며, 아래쪽으로 옮길 수있는 방법이 있습니까?
편집 3 : 안드로이드 변경 : 대신 wrap_content의 fill_parent하는 layout_height은 위치 문제
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<SurfaceView android:id="@+id/preview_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"/>
<com.google.zxing.client.android.ViewfinderView
android:id="@+id/viewfinder_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/transparent"/>
........
........
<TextView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="bottom"
android:text="Header text"/>
</FrameLayout>
감사합니다, 나는 내가 갖는 카메라 미리보기가 실제로 Zxing의 바코드 스캐너에서 연장되는 것을 언급 한 것이다. 나는 카메라 미리보기 크기를 줄이고, 아래쪽에 Textview를 갖고 싶다. 두 사람 모두 제안대로 TextView를 추가하려했지만 차이점을 볼 수 없습니다. 참조 용으로 zxing xml 파일 –
을 첨부 할 것입니다! 그러나 약간의 문제, 내가 작업중인 코드를 포함하도록 내 게시물을 편집했습니다. 중력이 제대로 작동하지 않는 것 같습니다./어딘가에 선형 레이아웃이 필요합니까? –
'android : layout_height = "wrap_content"'를 사용했지만 가로 중력이 의미를 가지려면'fill_parent'가되어야합니다. – inazaruk