首先,我已经在 SO 和 google 上进行了搜索,但没有找到适合我的问题的任何所需解决方案。我并不是要求向我提供代码。我需要建议如何解决我的问题。
所以我的问题是,我必须为 2-3 个 Activity
创建帮助向导,以引导用户完成 Activity
屏幕。我已经创建了帮助屏幕,但如果我在不同分辨率的手机上检查它,它不适合屏幕,这意味着我显示的用于指导用户如何操作应用程序的文本和图像。
因此需要一些建议,例如我如何创建屏幕。
这是我正在考虑的2个解决方案:
- 创建另一个具有相同布局的 Activity。
- 拍摄 Activity 的高分辨率屏幕截图,然后通过添加文本和图像对其进行修改,并在屏幕上显示该图像。
或者如果您有任何其他建议,我将不胜感激。
我的帮助向导屏幕布局代码之一是:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="0"
android:background="@color/black_actionBar"
android:gravity="center_vertical|left"
android:visibility="invisible" >
<LinearLayout
android:layout_width="40dp"
android:layout_height="match_parent"
android:gravity="center" >
<com.AppName.utils.ButtonRegularFont
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="0"
android:background="@drawable/back" />
</LinearLayout>
<com.AppName.utils.TextViewRegularFont
style="@style/textviews_whiteFont_header"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center"
android:lines="1"
android:text="Images" />
<com.AppName.utils.ImageViewSettings
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:src="@drawable/menu" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="0"
android:orientation="horizontal"
android:visibility="invisible" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<com.AppName.utils.ButtonRegularFont
style="@style/tabView_button_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="Hotel" />
<View
android:id="@+id/view_images_hotel"
style="@style/viewLineDisabled"
android:layout_width="match_parent" />
</LinearLayout>
<View
style="@style/tabview_divider"
android:layout_width="2dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<com.AppName.utils.ButtonRegularFont
style="@style/tabView_button_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="Rooms" />
<View
android:id="@+id/view_images_rooms"
style="@style/viewLineDisabled"
android:layout_width="match_parent" />
</LinearLayout>
</LinearLayout>
<Spinner
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_margin="5dp"
android:layout_weight="0"
android:background="@drawable/spinner_selector"
android:prompt="@string/select_room"
android:visibility="gone" />
<com.AppName.utils.ButtonRegularFont
style="@style/buttonStyle"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_margin="5dp"
android:layout_weight="0"
android:text="Add Image"
android:visibility="invisible" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<org.askerov.dynamicgrid.DynamicGridView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:layout_weight="1"
android:horizontalSpacing="1dp"
android:numColumns="3"
android:stretchMode="columnWidth"
android:verticalSpacing="1dp" />
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:src="@drawable/arrow"/>
<com.AppName.utils.TextViewCircular
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/white"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="120dp"
android:textStyle="bold"
android:textSize="18sp"
android:text="To start dragging an image just long press on any image and then it can be editable to drag to any position."/>
</FrameLayout>
<com.AppName.utils.ButtonRegularFont
style="@style/buttonStyle_CheckedList"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_weight="0"
android:text="Submit" />
这是图片:
在上图中,箭头与文本正确显示,但在某些手机中,它不会像图像中显示的那样显示。
最佳答案
拍摄高分辨率图像会增加 APK 大小,因此最好不要使用它。要制作屏幕向导,您可以使用 ShowTipsView图书馆 。因此您不必使用全屏图像来显示向导。
关于Android:帮助屏幕向导来指导用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31239556/