比率変更

LinearLayoutで部品を整列する。

前回はこちら

 前回は、デザインモードでアプリの画面いボタンを設置しました。今回は、複数の部品を組み合わせて縦横に並べるようです。

例によってstring.xmlへの追記から。

<string name="cd_drink">ドリンク</string>
<string name="cd_food">フード</string>

 さらに、activity_view_sample.xmlにコードを追加します。

( 前略)

android:inputType="text"/>
 

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#df7401"
android:orientation="horizontal">
 
<CheckBox
android:id="@+id/cdDrink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin_Right="25dp"
android:background="#ffffff"
android:text="@string/cd_drink"/>
 
<CheckBox
android:id="@+id/cdFoof"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ffffff"
android:text="@string/cd_food"/> 

 デザイン画面で確認してみると、例によって上手くいきません。

 本来ならばチェックボックス同士は離れて配置され、保存ボタンはその下にこなければならないのですが……むむむ。またテキストと入力した画面を見比べる作業に入ります。修正出来たら

 つづく!

テキストはこちら

ここから先は

0字

¥ 100

期間限定 PayPay支払いすると抽選でお得に!

この記事が気に入ったらサポートをしてみませんか?