日付をLinearLayout表示するボックスを作成するために使用するものがあります。
<LinearLayout android:id="@+id/date_layout"
android:background="@drawable/bg_frame"
android:layout_gravity="center"
android:layout_marginRight="3dp"
android:layout_rowSpan="3"
android:minWidth="65dp"
android:orientation="vertical"
>
<TextView android:id="@+id/date"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textColor="@android:color/holo_blue_bright"
android:textSize="20sp"
/>
<View
android:background="@android:color/holo_blue_bright"
android:layout_height="1dp"
android:layout_width="match_parent"
/>
<TextView android:id="@+id/day_of_week"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textColor="@android:color/holo_blue_bright"
/>
</LinearLayout>
それは素敵な小さなボックスになります(これはView上記のコードにはありません):
そこに入れるとView、ボックスが画面全体に広がります。ボックスの幅を変更せずに、ボックスの幅全体に線を引きたいのですが、コーディングしたとおりに機能しないのはなぜですか。android:layout_width="match_parent"単に収容の幅と一致するべきではありませんLinearLayoutか?なぜそれは2つで機能し、機能しTextViewsないのViewですか?
にLinearLayout含まれていGridLayoutます。
また、をに置き換えても、他のすべてをまったく同じままにすると、希望どおりに機能し、画面幅全体に拡大されないこともわかりましViewたTextView。TextViewが期待どおりに機能し、Viewが機能しないのはなぜですか?