0

我为我的应用程序创建了一个好看的布局,但我在线性布局中使用了相对布局(根据我的需要)。

这个可以吗?我的团队合作伙伴告诉我,这不符合 android 指南,这会使应用程序在搜索中失败。

所以基本上,我们应该如何使用布局有任何 限制吗?当应用程序在 Play 商店中时,Google 是否会监控这些代码。

这是代码(必须在编辑后放入)

           <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/bio2"
                    android:layout_below="@+id/bio1"
                    android:orientation="horizontal"
                    android:layout_marginTop="15dp">
                            <RelativeLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content">

                                        <TextView
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:text="Sagar Vakkala"
                                            android:textStyle="bold"
                                            android:textColor="#000"
                                            android:id="@+id/namebio"
                                            android:layout_marginLeft="15sp"
                                            />
                                        <TextView
                                            android:layout_width="match_parent"
                                            android:layout_height="wrap_content"
                                            android:layout_below="@id/namebio"
                                            android:textStyle="normal"
                                            android:text="From Delhi to Chennai in a whiff :)"
                                            android:textColor="#000"
                                            android:layout_marginLeft="15dp"
                                            android:layout_marginTop="10dp"
                                            />


                            </RelativeLayout>




                </LinearLayout>
4

3 回答 3

0

尝试减少另一层或两层内的嵌套线性布局是可以的,如果您尝试提出有点复杂的 UI,最好扩展 android ViewGroup 类并创建自己的视图

于 2016-10-25T11:54:30.880 回答
0

在您的情况下,您可以改用 ConstraintLayout 。

查看文档: https ://developer.android.com/training/constraint-layout/index.html

于 2016-10-25T11:48:16.813 回答
0

不,对于您添加的布局数量没有限制,也没有任何限制您必须遵循构建 Android 应用程序。然而谷歌确实监控你的应用程序,放在 PlayStore 上。

于 2016-10-25T11:36:10.550 回答