我创建了我的应用程序,其高度和宽度以像素为单位,用于分辨率为480x800的Pantech设备.
我需要转换G1设备的高度和宽度.我认为将其转换为dp将解决问题,并为两种设备提供相同的解决方案.
有没有简单的方法将像素转换为dp?有什么建议?

我必须从左到右移动指示器(因为平面图像).我也无法成功,因为expandableviewlist位于片段内,而不是整个活动内.任何的想法?谢谢!
以下方法在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)
`