Das ist mein Layout XML:Warum erscheint mein TextView ohne Grenzen in einem LinearLayout?
Und
<LinearLayout android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@drawable/border" />
<TextView android:text="ahahah 2!"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/border"
xmlns:android="http://schemas.android.com/apk/res/android" />
</LinearLayout>
dies die Grenze Definition lautet:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@android:color/white" />
<stroke android:width="1dip" android:color="#4fa5d5"/>
</shape>
Dies ist eine horizontale Linie zwischen den TextView
s erscheinen lässt, aber ich bin eine Grenze erwartet um den Text der TextView
s selbst. Wie mache ich das möglich?
nur nützlich sein können 'wrap_content' für die Höhe Attribut an Ihrem 2. TextView – convexHull
entfernen Sie dies aus der Ansicht: Android: Hintergrund = "@ Drawable/Border" und bieten Farbe dafür, es wird funktionieren. –