我的布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
card_view:cardCornerRadius="4dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/profilePic"
android:layout_width="96dp"
android:layout_height="96dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/avatar" />
</FrameLayout>
<RelativeLayout
android:id="@+id/user_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/header">
<ImageView
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:src="@color/contentDividerLine" />
<TextView
android:id="@+id/username"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="bottom"
android:drawablePadding="5dp"
android:padding="8dp"
android:text="Name"
android:textColor="@color/Black" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/user_view">
<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:src="@color/contentDividerLine" />
<TextView
android:id="@+id/email"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="bottom"
android:drawablePadding="5dp"
android:padding="8dp"
android:text="Email" …Run Code Online (Sandbox Code Playgroud) 我搜索了很多堆栈溢出的答案、文章,但无法得到具体的想法,这就是我问这个问题的原因,
参考资料:更好的 RESTful API 的 10 个最佳实践
我只是想知道,当我们在rest api中进行分页时,我们应该使用什么,在spring框架中,他们(page,size)默认提供在api中实现分页,我认为使用(page, size)更具有人类可读性并且更有意义,而不是(limit, offset),有什么原因吗spring 默认提供(page,size)而不是 limit,offset 并且许多答案都是为了证明它(limit,offset)比(page,size).