如何创建具有4个图标的android应用程序主屏幕?
我有4个图标。我想创建4个带有图标的矩形。我还想在图标下面添加文本。我应该使用哪些组件?如何实施? 我尝试了GridLayout和TableLayout,但我不知道怎么做。 我想使用材质设计来设计本机应用程序 我在photoshop中设计了演示仪表板。我的应用程序主屏幕应该如下所示 请帮忙!我是android初学者 请尝试此代码如何创建具有4个图标的android应用程序主屏幕?,android,android-layout,material-design,grid-layout,dashboard,Android,Android Layout,Material Design,Grid Layout,Dashboard,我有4个图标。我想创建4个带有图标的矩形。我还想在图标下面添加文本。我应该使用哪些组件?如何实施? 我尝试了GridLayout和TableLayout,但我不知道怎么做。 我想使用材质设计来设计本机应用程序 我在photoshop中设计了演示仪表板。我的应用程序主屏幕应该如下所示 请帮忙!我是android初学者 请尝试此代码 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http:/
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:background="@android:color/darker_gray"
android:layout_weight="0.5">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:layout_weight="0.5"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:background="@android:color/black"
android:layout_weight="0.5">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:layout_weight="0.5"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:background="@android:color/black"
android:layout_weight="0.5">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:layout_weight="0.5"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:background="@android:color/darker_gray"
android:layout_weight="0.5">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:layout_weight="0.5"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
请尝试此代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:background="@android:color/darker_gray"
android:layout_weight="0.5">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:layout_weight="0.5"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:background="@android:color/black"
android:layout_weight="0.5">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:layout_weight="0.5"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:background="@android:color/black"
android:layout_weight="0.5">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:layout_weight="0.5"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:background="@android:color/darker_gray"
android:layout_weight="0.5">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
android:layout_weight="0.5"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
您可以通过以下步骤通过线性布局完成上述任务 1.将版面垂直分为四部分:第一部分和第三部分为图像,第二部分和第四部分为文本 2.将每个垂直部分划分为2个水平部分
我已经用同样的方法完成了一项类似的任务,它对我来说非常适合。您可以通过以下步骤通过线性布局完成上述任务 1.将版面垂直分为四部分:第一部分和第三部分为图像,第二部分和第四部分为文本 2.将每个垂直部分划分为2个水平部分
我已经用同样的方法完成了类似的任务,它对我来说非常适合。谢谢。它正在工作,但我如何才能给出背景色矩形?我的图标是圆形的。请检查一下。谢谢。它正在工作,但我如何才能给出背景色矩形?我的图标是圆形的。请检查编辑的图标。。。