当前位置: 代码迷 >> Android >> 一个关于设置imagebutton的有关问题
  详细解决方案

一个关于设置imagebutton的有关问题

热度:63   发布时间:2016-05-01 21:41:29.0
一个关于设置imagebutton的问题
本人菜鸟,求各位大牛帮忙啊!在xml中怎么设置俩个imagebutton并列一行,且各占一半啊!额。。还有个问题,在listview中添加item,比如添加文档,貌似默认的新建的在之前建的下面,怎么让新建的文档在之前建的文档上面呢?

------解决方案--------------------
Java code
<LinearLayout         android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:orientation="horizontal">        <imagebutton            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:layout_weight="1"/>        <imagebutton            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:layout_weight="1"/>    </LinearLayout>
------解决方案--------------------
探讨

Java code

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<imagebutton
android:l……

------解决方案--------------------
第一个问题上面的已经回到了,我回答第二个,在activity里面,定义一个ArrayAdapter,使用数组给这个ArrayAdapter赋值,把你的新建的文档放在数字的前面,这样就可以了