<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="70dp"
android:layout_height="55dp"
android:text="nope"
android:id="@+id/cancel_arrive"
android:onClick="selectNotGoing"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:id="@+id/attendingEventInListviewRow"
android:layout_width="match_parent"
android:layout_height="28dp"
android:text="eventsName"
android:height="30sp"
android:textSize="22sp"
android:gravity="right"
android:tag="eventsName"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="eventDayOfTheWeek"
android:textColor="#000000"
android:id="@+id/eventDayOfTheWeekTxt"
android:gravity="right"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="eventTime"
android:textColor="#000000"
android:id="@+id/eventTimeTxt"
android:gravity="right"
/>
</LinearLayout>
</LinearLayout>
我試圖谷歌問題和實施解決方案,我在這裏找到。沒什麼幫助。上面的代碼是我當前的XML。我需要eventName
,eventDayOfTheWeek
和eventTime
留在右側。無法對齊佈局中的文本
我也嘗試清理該項目並重建它,但它保持不變。
(在預覽文本是在右側,發射後進入左側)
推出之前(在預覽):http://prntscr.com/db0f7t
(佈局:http://prntscr.com/db0ekp 發射後是列表視圖中的一行)
如果我運行它,文本在TextView中是右對齊的。你能指定你的情況發生了什麼? – weibeld
我也在預覽時看到右側的文字,但是當我啓動應用程序時,它會顯示在左側。 – Jack
嘗試爲TextView添加不同的背景顏色(例如'android:background =「#FF0000」'),以便更好地瞭解發生了什麼,然後可能會在問題中發佈屏幕截圖。 – weibeld