0
これは私のコードであるPictureレイアウトの幅をhorizontalscrollviewの内側に合わせる方法は?
(写真参照)私は、水平方向のLinearLayoutの幅に合わせたいが、それの最後にいくつかの空白がある:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.shahin.testing2.MainActivity">
<HorizontalScrollView
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="40px"
android:id="@+id/layout">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/Linear"
android:layout_gravity="center_horizontal"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
activity_main.xml
このコードを変更して最後に空白がないようにするにはどうすればよいですか?
@Peterhddが動作しません –