Java Android图书搜索应用程序搜索结果偶尔会出现在屏幕外
我的任务是为Android创建一个简单的图书搜索应用程序,作为一个实习项目。我差不多完成了,但我很不擅长做布局。如果ISBN的数字是10位数,那么发布的日期和描述将总是飞到屏幕的左边和外面,但如果它只有13位数的话,就完全可以了。仅供参考,我使用的是谷歌图书API。如果我可以发布图片,这会更清晰,但我的代表太低了 这是我的密码:Java Android图书搜索应用程序搜索结果偶尔会出现在屏幕外,java,android,Java,Android,我的任务是为Android创建一个简单的图书搜索应用程序,作为一个实习项目。我差不多完成了,但我很不擅长做布局。如果ISBN的数字是10位数,那么发布的日期和描述将总是飞到屏幕的左边和外面,但如果它只有13位数的话,就完全可以了。仅供参考,我使用的是谷歌图书API。如果我可以发布图片,这会更清晰,但我的代表太低了 这是我的密码: <RelativeLayout android:layout_width="match_parent" android:layout_height="ma
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/img_cover"
android:layout_width="180dp"
android:layout_height="170dp"
android:src="@drawable/img_books_large"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/tvTitle"
android:text="Title"
android:layout_marginTop="20dp"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/img_cover"
android:layout_toEndOf="@+id/img_cover" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Author"
android:id="@+id/tvAuthor"
android:layout_marginTop="25dp"
android:layout_below="@+id/tvTitle"
android:layout_toRightOf="@+id/img_cover"
android:layout_toEndOf="@+id/img_cover" />
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_below="@+id/img_cover"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="ISBN"
android:id="@+id/tvISBN"
android:layout_below="@+id/img_cover"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Publish Date"
android:id="@+id/tvPublishYear"
android:layout_below="@+id/tvISBN"
android:layout_marginTop="40dp"
android:layout_marginLeft="-220dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tvDescription"
android:layout_marginTop="80dp"
android:layout_below="@+id/tvPublishYear"
android:layout_marginLeft="-270dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Description"
/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
提前感谢Nvm修复了它。
我不得不补充一句
android:orientation=“垂直”
要线性布局,Nvm将其修复。
我不得不补充一句
android:orientation=“垂直”
直线布置