【发布时间】:2016-08-24 09:46:25
【问题描述】:
我修改了我的应用程序,即将应用程序的样式从可扩展的 lisview 更改为将其内容显示到带有 pagetitlestrip 的 viewpager。现在我的应用更可爱了,但自从我的新更新发布以来,卸载量增加了很多。
我很确定用户正在卸载我的应用,因为他们不知道必须向左滑动才能看到应用的下一个内容。
所以我认为我需要为用户添加一些帮助。我想到了一个向右箭头的浮动图像视图,并带有一条消息,显示文本“向右移动以查看更多内容”和一个关闭按钮。
实现这一目标的最佳策略是什么?谁应该使用一些 xml 技巧?还是应该由java代码完成?任何示例代码都会很棒。
这是我的 xml 布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The main content view -->
<RelativeLayout
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.PagerTitleStrip
android:id="@+id/pager_title_strip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:paddingTop="4dp"
android:paddingBottom="4dp"
style="@style/CustomPagerTitleStrip"/>
</android.support.v4.view.ViewPager>
</RelativeLayout>
<!-- The navigation drawer -->
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/drawer_header"
app:menu="@menu/drawer_menu"
style="@style/NavigationDrawerStyle"/>
</android.support.v4.widget.DrawerLayout>
【问题讨论】:
-
你可以试试这样的:github.com/amlcurran/ShowcaseView
-
@Opoo 我更喜欢在我的应用中添加一个小代码而不是第三方库,但是谢谢
-
@Opoo 我正在尝试您的建议,但似乎不能与使用 AppCompatActivity 的较新项目一起使用,我收到此错误:java.lang.RuntimeException: insertShowcaseViewWithType cannot be used when the theme没有ActionBar
-
真可惜。显然他们并没有很好地维护它。也许手动解决方案会起作用。
标签: android android-layout android-viewpager android-animation android-xml