Android中的个性化列表视图,如Facebook Messenger或Viber
我从Android开发开始,正在开发一个应用程序,其中我有一个列表视图,我想像Viber这样的应用程序一样滚动,我们可以选择滚动到上面有固定条的旧消息,如图所示Android中的个性化列表视图,如Facebook Messenger或Viber,android,Android,我从Android开发开始,正在开发一个应用程序,其中我有一个列表视图,我想像Viber这样的应用程序一样滚动,我们可以选择滚动到上面有固定条的旧消息,如图所示 感谢您的建议。看起来您需要类似的建议: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap
感谢您的建议。看起来您需要类似的建议:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/top_control_bar">
<Spinner
android:id="@+id/sort_by"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
<LinearLayout
android:id="@+id/bottom_control_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Add Item" />
</LinearLayout>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:choiceMode="multipleChoice"
android:layout_below="@id/top_control_bar"
android:layout_above="@id/bottom_control_bar"></ListView>
<TextView
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/top_control_bar"
android:layout_above="@id/bottom_control_bar" />
</RelativeLayout>
使用上面的布局,您可以通过页眉中的微调器
和页脚中的按钮
实现所需
资料来源:
要实现与Viber类似的聊天布局,请参见以下链接:
非常感谢@Leigh的回答,非常有用。我想要更多更接近目标的建议——如果可能的话——任何方式。谢谢。@user3232174您需要更清楚地知道您要找的是什么。这个布局应该能满足你的需要,你还有什么需要解决的吗?实际上@Leigh我至少想知道Viber for Android的设计师是如何制作聊天列表的。希望这是清楚的,,thnx@user3232174请看我答案中的链接,这些应该会帮助你。非常感谢@Leigh will。我要放弃它吗