Ich habe ein Widget erstellt, das ein LinearLayout verwendet, und ich habe zwei TextViews in das Layout eingefügt. Die Schwerkraft des Layouts ist "top".Wie werden zusätzliche Abstände in LinearLayout beseitigt?
Das Problem ist, dass ich einen Abstand zwischen den beiden TextViews bekomme und ich kann es nicht loswerden.
<TextView
android:id="@+id/Text01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="bottom|center_horizontal"
android:text="blah blah"
android:background="@android:color/transparent"
android:textColor="#3e6eb4"
android:textSize="11sp"
/>
<TextView
android:id="@+id/text02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="top|center_horizontal"
android:text=""
android:background="@android:color/transparent"
android:textColor="#3e6eb4"
android:textSize="14sp"
android:padding="0sp"
android:verticalSpacing="0sp"
/>
Wie Sie sehen Ich habe versucht Putting padding 0 und verticalSpacing 0, aber ich habe noch einen Raum zwischen ihnen.
Wie kann ich es beheben?
Danke.
Meinst du Platz zwischen Text in zwei TextViews? –
sp wird normalerweise für die Schriftgröße verwendet, für andere Dinge verwenden Sie dp. http://stackoverflow.com/questions/2025282/difference-of-px-dp-dip-and-sp-in-android –
@Orsol: Ja, der vertikale Abstand zwischen den beiden TextViews – Ran