gpt4 book ai didi

android - android 中 gridview 上方的角菜单

转载 作者:行者123 更新时间:2023-11-29 01:41:08 25 4
gpt4 key购买 nike

大家好,我需要这个东西,我附上了图片。请帮助我,我是 android 新手。有角菜单..打开角菜单后有gridview,它应该在gridview之上。我在我的 xml 中引用了一个名为卫星菜单的库,这里是我的 xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:foursquared="http://schemas.android.com/apk/res/com.infotech.zeus"
xmlns:tools="http://schemas.android.com/tools"
xmlns:sat="http://schemas.android.com/apk/lib/android.view.ext"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:gravity="center_horizontal"
tools:context=".MainActivity" >

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" >

<android.view.ext.SatelliteMenu
android:id="@+id/cornermenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
sat:closeOnClick="true"
sat:expandDuration="400"
sat:satelliteDistance="70"
sat:totalSpacingDegree="90" />
</LinearLayout>

<GridView
android:id="@+id/gv_main_gridView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/navigation"
android:layout_alignRight="@+id/navigation"
android:layout_below="@+id/navigation"
android:layout_marginBottom="50dp"
android:layout_marginTop="20dp"
android:clickable="true"
android:gravity="center"
android:horizontalSpacing="5dp"
android:numColumns="auto_fit"
android:scrollbars="none"
android:stretchMode="columnWidth"
android:verticalSpacing="5dp" >

</GridView>

<ImageView
android:id="@+id/iv_main_companylogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="25dp"
android:layout_marginTop="25dp"
android:src="@drawable/company_logo" />

<TextView
android:id="@+id/alerttext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="60dp"
android:layout_marginRight="5dp"
android:layout_toLeftOf="@+id/ll_alertcounter"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:paddingLeft="5dip"
android:paddingRight="5dip"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="ALERTS"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#FFFFFF" />

<com.echo.holographlibrary.LineGraph
android:id="@+id/linegraph"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_below="@+id/iv_main_companylogo" />

<com.infotech.zeus.widget.SegmentedButton
android:id="@+id/navigation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linegraph"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="20dp"
foursquared:btnPaddingBottom="7dip"
foursquared:btnPaddingTop="7dip"
foursquared:cornerRadius="4dip"
foursquared:gradientColorOffEnd="#2e6584"
foursquared:gradientColorOffStart="#3b7d9e"
foursquared:gradientColorOnEnd="#3a7ca2"
foursquared:gradientColorOnStart="#4c9dc3"
foursquared:gradientColorSelectedEnd="#FFAA00"
foursquared:gradientColorSelectedStart="#FFAA00"
foursquared:strokeColorr="#326e90"
foursquared:strokeWidthh="1dip"
foursquared:textStyle="@style/TextViewStyleHeaderButtonBlue" />

<LinearLayout
android:id="@+id/ll_alertcounter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="8dp" >

<TextView
android:id="@+id/tv_alertleftcount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/tv_alertOF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="OF"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#52A3D0" />

<TextView
android:id="@+id/tv_alertrightcount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>

<TextView
android:id="@+id/welcome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:text="WELCOME"
android:textColor="#FFFFFF" />

<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/welcome"
android:layout_below="@+id/welcome"
android:text="MR. TONY STARK"
android:textColor="#FFFFFF" />

</RelativeLayout>

最佳答案

enter image description here
将包含卫星菜单的 linearLayout 移动到 xml 中的 GridView 下。它将在 GridView 顶部呈现菜单

关于android - android 中 gridview 上方的角菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24608654/

25 4 0