我有一个Android ListView。
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/myListView"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" >
有时它只包含一些项目,有时只包含一项。
在这种情况下,这几个项目以listview为中心。但是我希望这些项目从顶部开始而不是居中。
怎么做?
答案 0 :(得分:1)
<system.web>
<authentication mode="Windows" />
<roleManager defaultProvider="MyRoleProvider" enabled="true">
<providers>
<clear />
<add name="MyRoleProvider" type="CWC_Service_Plan.Security.MyRoleProvider" />
</providers>
</roleManager>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
</system.web>
以上2行使您的列表视图成为其父级的中心。因此您获得的项目以列表视图为中心。
你可以删除android:layout_centerVertical =&#34; true&#34;从您的代码中再试一次?