关于可扩展列表视图,组图标指示器位于左侧,我可以移动指示器并将其定位在右侧吗?谢谢.
编辑:由于我不想扩展视图,我得到了动态获取宽度的解决方法.只是分享我的解决方案
Display newDisplay = getWindowManager().getDefaultDisplay(); int width = newDisplay.getWidth(); newListView.setIndicatorBounds(width-50, width);
我正在尝试创建一个ExpandableListView.群组的初始视图显示正常.但是,当我单击列表项时,我的箭头不会更改.见下图.
如何更改箭头的方向?
我有布局XML:
<ExpandableListView
android:id="@+id/expandable_list"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:divider="@null"
android:background="#ffffff"
android:groupIndicator="@drawable/settings_selector"
android:transcriptMode="alwaysScroll" />
Run Code Online (Sandbox Code Playgroud)
settings_selector.xml:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" >
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/arrow_down"
android:state_empty="true"/>
<item
android:drawable="@drawable/arrow_right"
android:state_expanded="true"/>
</selector>
</animation-list>
Run Code Online (Sandbox Code Playgroud) 以下方法在android版本的jellybean 4.3中不起作用.
historyExpaLV.setIndicatorBounds(historyExpaLV.getRight() - 60,
historyExpaLV.getWidth() - 8);
Run Code Online (Sandbox Code Playgroud)
有谁知道解决方案?提前致谢.
我正在开发一个设计的Android应用程序.
这里exapandablelistview的默认图标指示器显示在左侧.如何在列表视图的右侧显示此图标指示符?,Xml文件中是否有任何更改可以实现此操作?
我的xml代码是
`
<ExpandableListView
android:id="@+id/expandableListView"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:indicatorRight="?android:attr/expandableListPreferredItemIndicatorRight"
android:dividerHeight="0.7dp" />
Run Code Online (Sandbox Code Playgroud)
`