android中的圆形菜单
我正在尝试创建一个圆形菜单,如下所示: 我正在使用ArcMenu库。 我的android中的圆形菜单,android,android-linearlayout,Android,Android Linearlayout,我正在尝试创建一个圆形菜单,如下所示: 我正在使用ArcMenu库。 我的xml代码是 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:arc="http://schemas.android.com/apk/res-auto" android:layout_width="fill_paren
xml
代码是
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:arc="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.capricorn.ArcMenu
android:id="@+id/arc_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
而且产出并没有全面增长
输出是这样来的:
请告诉我如何设置圆形菜单
我是android的新手,请帮我试试
arcLayout.setArc(0.0f, 360.0f);
编辑:
您的以下代码没有任何用处:
ArcLayout arcLayout= new ArcLayout(this);
arcLayout.setChildSize(50);
arcLayout.setArc(0.0f, 300.0f);
您只需按如下所示更改布局代码,然后检查
<com.capricorn.ArcMenu
android:id="@+id/arc_menu_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
arc:fromDegrees="0.0"
arc:toDegrees="360.0"
arc:childSize="50dp"/>
您必须在ArcMenu中更改度数,只需去掉arcLayout.setChildSize(50)代码>和arcLayout.setArc(0.0f,300.0f)
和TryTanks bro,但我已经使用了这个,它不起作用了。更多库在此感谢replay bro,但我希望这就是我所做的,你必须定义到度,从度从0.0到360.0,才能得到圆形布局。@user3145614查看我的更新答案。实际上,您根本没有在ArcMenu中设置度数。这就是为什么它没有向你展示结果。您只是在ArcLayout
中切换,而不是在ArcMenu
中。仅供参考ArcLayout
用于创建动态ArcLayout
,并在其中创建ArcMenu
。
<com.capricorn.ArcMenu
android:id="@+id/arc_menu_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
arc:fromDegrees="0.0"
arc:toDegrees="360.0"
arc:childSize="50dp"/>