如何修复文本视图?
我的预览XML有问题,cardView
在模拟器上完美显示,但在手机上没有显示。
我喜欢第一个textView
在右侧,第二个textView
在左侧。
我的手机在希伯来语中。
Android Studio:
但是在我的手机上,我看到了(Galaxy Note 5 Ultra):
我该如何解决?
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardCornerRadius="6dp"
android:elevation="6dp"
app:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="372dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:orientation="vertical"
android:background="@color/white">
//airplane
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/airplanetitl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:padding="1dp"
android:text="Airplane:"
android:textColor="@color/black"
android:textSize="26sp"
android:textStyle="bold" />
<TextView
android:id="@+id/Airplanename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="8dp"
android:text="676"
android:textColor="@color/black"
android:textSize="26sp" />
</LinearLayout>
I have a problem on my preview XML, the cardview
shows perfectly on the emulator but not on my phone.
I like the first textview
to be on the right side and the second textview
to be on the left side.
My phone is in Hebrew.
Android Studio:
But on my phone, I see it like that (Galaxy Note 5 Ultra):
How can I fix that?
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardCornerRadius="6dp"
android:elevation="6dp"
app:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="372dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:orientation="vertical"
android:background="@color/white">
//airplane
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/airplanetitl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:padding="1dp"
android:text="Airplane:"
android:textColor="@color/black"
android:textSize="26sp"
android:textStyle="bold" />
<TextView
android:id="@+id/Airplanename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="8dp"
android:text="676"
android:textColor="@color/black"
android:textSize="26sp" />
</LinearLayout>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论