質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.44%
XML

XMLは仕様の1つで、マークアップ言語群を構築するために使われています。

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Q&A

解決済

1回答

1213閲覧

透明なビューを重ねて別ビューの高さに合わせて表示をする方法を教えてください。

ToaZI

総合スコア39

XML

XMLは仕様の1つで、マークアップ言語群を構築するために使われています。

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

0グッド

0クリップ

投稿2021/05/08 15:32

TextureView(カメラのプレビュー)の上に垂直方向の線を重ねたいです。
Framelayoutなどを使用してみましたがうまくいかず、方法があれば教えていただきたいです。

よろしくお願いいたします。

AutoTextureView

1<com.example.myapplication.video.AutoFitTextureView 2 android:id="@+id/texture" 3 android:layout_width="wrap_content" 4 android:layout_height="wrap_content" 5 android:foregroundGravity="center" />

垂直線↓

view

1<LinearLayout 2 android:layout_width="match_parent" 3 android:layout_height="match_parent" 4 android:orientation="horizontal"> 5 6 <View 7 android:id="@+id/view2" 8 android:layout_width="0sp" 9 android:layout_height="wrap_content" 10 android:layout_weight="4.9" /> 11 12 <View 13 android:id="@+id/view3" 14 android:layout_width="0dp" 15 android:layout_height="wrap_content" 16 android:layout_weight="0.2" 17 android:background="#FFC107" 18 /> 19 20 <View 21 android:id="@+id/view4" 22 android:layout_width="0dp" 23 android:layout_height="wrap_content" 24 android:layout_weight="4.9" /> 25 </LinearLayout>

試行コード

  <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <com.example.myapplication.video.AutoFitTextureView android:id="@+id/texture" android:layout_width="wrap_content" android:layout_height="wrap_content" android:foregroundGravity="center" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="horizontal"> <View android:id="@+id/view" android:layout_width="0sp" android:layout_height="match_parent" android:layout_weight="6.4" /> <View android:id="@+id/view0" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="0.2" android:background="#FFC107" /> <View android:id="@+id/view00" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="3.4" /> </LinearLayout>

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ToaZI

2021/05/08 16:10

いつもありがとうございます。 確認してみます。
guest

回答1

0

自己解決

試行錯誤の末、ConstraintLayoutを使用しフィットさせることができました。

<androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"> <com.example.myapplication.video.AutoFitTextureView android:id="@+id/texture" android:layout_width="wrap_content" android:layout_height="wrap_content" android:foregroundGravity="center" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" app:layout_constraintBottom_toBottomOf="@+id/texture"> <View android:id="@+id/view2" android:layout_width="0sp" android:layout_height="**match_parent**" android:layout_weight="4.9" /> <View android:id="@+id/view3" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="0.2" android:background="#FFC107" /> <View android:id="@+id/view4" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="4.9" /> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>

app:layout_constraintBottom_toBottomOf="@+id/texture"でボトム位置を被らせ
親のLinearLayoutをwrap_contentに子のviewはmatch_parentにすることで可能になりました。

投稿2021/05/08 18:41

ToaZI

総合スコア39

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.44%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問