【发布时间】:2017-08-02 10:11:10
【问题描述】:
我想设计这种类型的xml页面。我尝试了很多代码。每次都有新的问题出现。我需要固定底部导航栏。在网格视图中,我想要 android:numColums=3、android:verticalSpacing 和 android:horizontalSpacing 相同(看起来像 instagram 个人资料视图网格图像)。
XML 代码:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".MainSettingClass">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="175dp"
android:background="#dadada"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/profile_image"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/com_facebook_button_background"/>
<TextView
android:id="@+id/amsc_txt_fbusername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="TextView"
android:layout_marginTop="2dp" />
</LinearLayout>
<GridView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/grid_test"
android:verticalSpacing="2dp"
android:horizontalSpacing="2dp"
android:background="#FFFFFF"
android:stretchMode="columnWidth"
android:columnWidth="85dp"
android:numColumns="3"/>
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_gallery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#ffffff"
app:menu="@menu/bottom_navigation_gallery"/>
</FrameLayout>
【问题讨论】:
-
你做了什么??
-
我尝试了很多代码...你的代码在哪里?
-
展示您为实现相同目标所做的努力?
-
向我们展示您尝试过的任何代码
-
等我把代码贴出来
标签: java android xml android-layout android-gridview