私はiOSアプリを開発し、現在はAndroid版で作業しています。マスクされた四角形をプログラムで作成する
カメラビュー(SurfaceView)の上にオーバーレイビューを作成したいと思います。私が現在複製できない部分は、画面の真ん中にマスクされた四角いオーバーレイです。私はandroid.support.percent.PercentFrameLayout
を試しましたが、それは私が欲しいものとして動作しません。
iOS版では、8つの矩形UIViewを作成してそのシェイプを作成するだけです。次に、CGRectを設定してレイアウトします。 Androidの場合、コードを使用してランタイムを作成できることはわかっています。しかし、私が知らない部分は、それらをレイアウトする方法です。
私はどのようなやり方でアドバイスをしたいですか(XML、またはプログラムでレンダリング)。
ありがとうございます!あなたは、単にプロパティテキストスキャンをcontaing "android:layout_alignParentBottom="true"
に設定してお支払いTextView
を置くことができます
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.nerfire.hk.flexibill.ScanMain">
<!-- TODO: Update blank fragment layout -->
<SurfaceView
android:id="@+id/camera_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<!--<android.support.percent.PercentFrameLayout-->
<!--android:orientation="vertical"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent">-->
<!--<View-->
<!--android:layout_width="match_parent"-->
<!--app:layout_heightPercent="68%"-->
<!--/>-->
<!--</android.support.percent.PercentFrameLayout>-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="10dp"
android:text="Scan and Pay!"/>
</FrameLayout>
現在のレイアウトファイルを表示 –
質問をアップロードして更新しました。 –