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

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

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

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

Visual Studio

Microsoft Visual StudioはMicrosoftによる統合開発環境(IDE)です。多種多様なプログラミング言語に対応しています。

Android

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

Xamarin

Xamarin(ザマリン)は、iPhoneなどのiOSやAndroidで動作し、C# 言語を用いてアプリを開発できるクロスプラットフォーム開発環境です。Xamarin Studioと C# 言語を用いて、 iOS と Android の両方の開発を行うことができます。

Q&A

0回答

347閲覧

XamarinでのAndroidアプリ画面デザインでのトラブル

Engineer_H6

総合スコア0

XML

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

Visual Studio

Microsoft Visual StudioはMicrosoftによる統合開発環境(IDE)です。多種多様なプログラミング言語に対応しています。

Android

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

Xamarin

Xamarin(ザマリン)は、iPhoneなどのiOSやAndroidで動作し、C# 言語を用いてアプリを開発できるクロスプラットフォーム開発環境です。Xamarin Studioと C# 言語を用いて、 iOS と Android の両方の開発を行うことができます。

0グッド

0クリップ

投稿2022/04/02 05:30

XamarinでのAndroidアプリ画面デザインでのトラブル

以下のxmlを作成したのですが、以下の画像のように「Scroll View can host only one direct child」と表示され、画面のデザインが表示されなくなりました。

イメージ説明

どうしたらよいでしょうか、教えてください。

開発環境:Visual Studio 2022,Xamarin

xml

1<?xml version="1.0" encoding="utf-8"?> 2<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:app="http://schemas.android.com/apk/res-auto" 4 xmlns:tools="http://schemas.android.com/tools" 5 android:layout_width="match_parent" 6 android:layout_height="match_parent"> 7 8 9 <TextView 10 android:id="@+id/FWS_Textview1" 11 android:layout_width="122dp" 12 android:layout_height="20dp" 13 android:layout_marginTop="10dp" 14 android:layout_marginStart="10dp" 15 android:text="フリーワード検索" 16 app:layout_constraintBottom_toBottomOf="parent" 17 app:layout_constraintHorizontal_bias="0.634" 18 app:layout_constraintLeft_toLeftOf="parent" 19 app:layout_constraintRight_toRightOf="parent" 20 app:layout_constraintStart_toStartOf="parent" 21 app:layout_constraintTop_toTopOf="parent" /> 22 23 <LinearLayout 24 android:id="@+id/FWS_LinearLayout1" 25 android:layout_width="match_parent" 26 android:layout_height="59dp" 27 android:layout_marginTop="30dp" 28 android:layout_marginStart="10dp" 29 android:layout_marginEnd="10dp" 30 android:orientation="horizontal" 31 app:layout_constraintBottom_toBottomOf="parent" 32 app:layout_constraintStart_toStartOf="parent" 33 app:layout_constraintEnd_toEndOf="parent" 34 app:layout_constraintTop_toBottomOf="@+id/FWS_Textview1" 35 app:layout_constraintVertical_bias="0.0"> 36 37 <EditText 38 android:id="@+id/FWInput_editTextText" 39 android:layout_width="250dp" 40 android:layout_height="50dp" 41 android:ems="10" 42 android:inputType="textPersonName" 43 app:layout_constraintStart_toStartOf="parent" /> 44 45 <Button 46 android:id="@+id/FWS_button" 47 android:layout_width="80dp" 48 android:layout_height="wrap_content" 49 android:layout_marginStart="10dp" 50 android:text="検索" 51 app:layout_constraintStart_toStartOf="@+id/FWInput_editTextText" /> 52 53 </LinearLayout> 54 55 <TextView 56 android:id="@+id/SC_textView1" 57 android:layout_width="wrap_content" 58 android:layout_height="20dp" 59 android:layout_marginTop="90dp" 60 android:layout_marginStart="10dp" 61 android:text="検索条件" 62 app:layout_constraintStart_toStartOf="parent" 63 app:layout_constraintTop_toBottomOf="@+id/FWS_Textview1" /> 64 65 <ScrollView 66 android:id="@+id/SC_scrollView1" 67 android:layout_width="match_parent" 68 android:layout_height="800dp" 69 android:layout_marginTop="300dp" 70 app:layout_constraintStart_toStartOf="parent" 71 app:layout_constraintEnd_toEndOf="parent" 72 app:layout_constraintTop_toBottomOf="parent" 73 tools:layout_editor_absoluteX="1dp" 74 tools:layout_editor_absoluteY="149dp"> 75 76 <LinearLayout 77 android:id="@+id/SC_LinearLayout1" 78 android:layout_width="match_parent" 79 android:layout_height="wrap_content" 80 android:layout_marginStart="10dp" 81 android:layout_marginTop="10dp" 82 android:orientation="vertical" 83 app:layout_constraintStart_toStartOf="parent" 84 app:layout_constraintEnd_toEndOf="parent"> 85 86 <TextView 87 android:id="@+id/RDate_textView1" 88 android:layout_width="wrap_content" 89 android:layout_height="20dp" 90 android:layout_marginTop="10dp" 91 android:text="記録日" 92 app:layout_constraintStart_toStartOf="parent" 93 app:layout_constraintTop_toBottomOf="@+id/SC_textView1" /> 94 95 <TableLayout 96 android:id="@+id/RDate_TableLayout1" 97 android:layout_width="match_parent" 98 android:layout_height="match_parent" 99 android:layout_marginTop="10dp" 100 app:layout_constraintStart_toStartOf="parent" 101 app:layout_constraintEnd_toEndOf="parent" 102 app:layout_constraintTop_toBottomOf="@+id/RDate_textView1"> 103 104 <TableRow 105 android:id="@+id/RDateStart_TableRow1" 106 android:layout_width="wrap_content" 107 android:layout_height="match_parent"> 108 109 <Spinner 110 android:id="@+id/RYear_spinner1" 111 android:layout_width="120dp" 112 android:layout_height="40dp" 113 android:layout_marginStart="10dp" 114 android:layout_marginTop="10dp" /> 115 116 <TextView 117 android:id="@+id/RYear_textView1" 118 android:layout_width="wrap_content" 119 android:layout_height="wrap_content" 120 android:layout_marginStart="4dp" 121 android:text="" /> 122 123 <Spinner 124 android:id="@+id/RMonth_spinner1" 125 android:layout_width="79dp" 126 android:layout_height="40dp" 127 android:layout_marginStart="4dp" /> 128 129 <TextView 130 android:id="@+id/RMonth_textView1" 131 android:layout_width="wrap_content" 132 android:layout_height="wrap_content" 133 android:layout_marginStart="8dp" 134 android:text="" /> 135 136 <Spinner 137 android:id="@+id/RDay_spinner1" 138 android:layout_width="80dp" 139 android:layout_height="40dp" 140 android:layout_marginStart="8dp" /> 141 142 <TextView 143 android:id="@+id/RDay_textView1" 144 android:layout_width="17dp" 145 android:layout_height="23dp" 146 android:layout_marginStart="10dp" 147 android:text="" /> 148 149 </TableRow> 150 151 <TableRow 152 android:id="@+id/RDateEnd_TableRow1" 153 android:layout_width="match_parent" 154 android:layout_height="match_parent"> 155 156 <Spinner 157 android:id="@+id/RYear_spinner2" 158 android:layout_width="120dp" 159 android:layout_height="40dp" 160 android:layout_marginStart="8dp" 161 android:layout_marginTop="10dp" /> 162 163 <TextView 164 android:id="@+id/RYear_textView2" 165 android:layout_width="wrap_content" 166 android:layout_height="wrap_content" 167 android:layout_marginStart="4dp" 168 android:layout_marginTop="30dp" 169 android:text="" /> 170 171 <Spinner 172 android:id="@+id/RMonth_spinner2" 173 android:layout_width="79dp" 174 android:layout_height="40dp" 175 android:layout_marginStart="4dp" 176 android:layout_marginTop="10dp" /> 177 178 <TextView 179 android:id="@+id/RMonth_textView2" 180 android:layout_width="wrap_content" 181 android:layout_height="wrap_content" 182 android:layout_marginStart="8dp" 183 android:layout_marginTop="28dp" 184 android:text="" /> 185 186 <Spinner 187 android:id="@+id/RDay_spinner2" 188 android:layout_width="80dp" 189 android:layout_height="40dp" 190 android:layout_marginStart="8dp" 191 android:layout_marginTop="10dp" /> 192 193 <TextView 194 android:id="@+id/RDay_textView2" 195 android:layout_width="17dp" 196 android:layout_height="23dp" 197 android:layout_marginStart="8dp" 198 android:layout_marginTop="20dp" 199 android:text="" /> 200 </TableRow> 201 202 </TableLayout> 203 204 <TextView 205 android:id="@+id/Category_textView1" 206 android:layout_width="wrap_content" 207 android:layout_height="20dp" 208 android:layout_marginTop="30dp" 209 android:text="カテゴリ" 210 app:layout_constraintStart_toStartOf="parent" 211 app:layout_constraintTop_toBottomOf="@+id/RDate_TableLayout" /> 212 213 <TableLayout 214 android:id="@+id/Category_TableLayout1" 215 android:layout_width="match_parent" 216 android:layout_height="match_parent" 217 android:layout_marginTop="10dp" 218 app:layout_constraintStart_toStartOf="parent" 219 app:layout_constraintEnd_toEndOf="parent" 220 app:layout_constraintTop_toBottomOf="@+id/Category_textView1"> 221 222 <TableRow 223 android:id="@+id/Category_TableRow1" 224 android:layout_width="match_parent" 225 android:layout_height="match_parent"> 226 227 // --------------(中略)-------------------------- 228 229 </TableLayout> 230 231 </ScrollView> 232 233</RelativeLayout>

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

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

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

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

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

jimbe

2022/04/02 07:17 編集

各タグの開き・閉じの対応がとれていますでしょうか。 多数のタグで階層が深くなり分かり難くなる場合は、 include タグ等のご利用も良いかと思います。 ついでに、app:layout_constraint ほにゃららというのが多数ありますが、これは CostraintLayout 用のパラメータで、他のレイアウト内では無視されると思います。 利用されているレイアウトに合わせて記述を見直されては如何でしょうか。
Zuishin

2022/04/02 08:05

> Scroll View can host only one direct child ScrollView には直接の子要素は一つしか入れられません。 OK <ScrollView><LinearLayout/></ScrollView> NG <ScrollView><LinearLayout/><TableLayout/></ScrollView>
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問