解决方案 »

  1.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="100dip"
         android:layout_height="50dip"
         android:orientation="horizontal"
         >
        <Button 
            android:id="@+id/btn"
            android:text="查看"
            android:layout_weight="1.0"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="自己写"/>
        <Button 
            android:id="@+id/btn1"
            android:text="删除"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:background="自己写"
            />
        
    </LinearLayout>
      

  2.   

    你的思路没问题啊,popupwindow里面自己布局,做两个控件分别给不同的背景图片
      

  3.   


    是的呀
    像这样的popupwindow是怎么获取当前listview的位置的。红色框是一个按钮,点击此处才弹出popupwindow!
    因为不是点击listview。就不知道怎么获取当前位置
      

  4.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="100dip"
         android:layout_height="50dip"
         android:orientation="horizontal"
         >
        <Button 
            android:id="@+id/btn"
            android:text="查看"
            android:layout_weight="1.0"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="自己写"/>
        <Button 
            android:id="@+id/btn1"
            android:text="删除"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:background="自己写"
            />
        
    </LinearLayout>谢谢谢谢,还请教一个问题,上图是怎么获取当前listview的位置的。。
      

  5.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="100dip"
         android:layout_height="50dip"
         android:orientation="horizontal"
         >
        <Button 
            android:id="@+id/btn"
            android:text="查看"
            android:layout_weight="1.0"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="自己写"/>
        <Button 
            android:id="@+id/btn1"
            android:text="删除"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:background="自己写"
            />
        
    </LinearLayout>谢谢谢谢,还请教一个问题,上图是怎么获取当前listview的位置的。。这个view获取要放在adapter中,然后实现popupwindow显示在这个view的下面
      

  6.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="100dip"
         android:layout_height="50dip"
         android:orientation="horizontal"
         >
        <Button 
            android:id="@+id/btn"
            android:text="查看"
            android:layout_weight="1.0"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="自己写"/>
        <Button 
            android:id="@+id/btn1"
            android:text="删除"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:background="自己写"
            />
        
    </LinearLayout>谢谢谢谢,还请教一个问题,上图是怎么获取当前listview的位置的。。这个view获取要放在adapter中,然后实现popupwindow显示在这个view的下面区别只在于显示popupwindow的代码要写在adapter内部或者是将内部获取的view传参出去
      

  7.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="100dip"
         android:layout_height="50dip"
         android:orientation="horizontal"
         >
        <Button 
            android:id="@+id/btn"
            android:text="查看"
            android:layout_weight="1.0"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="自己写"/>
        <Button 
            android:id="@+id/btn1"
            android:text="删除"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:background="自己写"
            />
        
    </LinearLayout>谢谢谢谢,还请教一个问题,上图是怎么获取当前listview的位置的。。这个view获取要放在adapter中,然后实现popupwindow显示在这个view的下面区别只在于显示popupwindow的代码要写在adapter内部或者是将内部获取的view传参出去
    谢谢。哈哈。想起来了
      

  8.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="100dip"
         android:layout_height="50dip"
         android:orientation="horizontal"
         >
        <Button 
            android:id="@+id/btn"
            android:text="查看"
            android:layout_weight="1.0"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="自己写"/>
        <Button 
            android:id="@+id/btn1"
            android:text="删除"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:background="自己写"
            />
        
    </LinearLayout>谢谢谢谢,还请教一个问题,上图是怎么获取当前listview的位置的。。这个view获取要放在adapter中,然后实现popupwindow显示在这个view的下面区别只在于显示popupwindow的代码要写在adapter内部或者是将内部获取的view传参出去
    谢谢。哈哈。想起来了我的分
      

  9.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="100dip"
         android:layout_height="50dip"
         android:orientation="horizontal"
         >
        <Button 
            android:id="@+id/btn"
            android:text="查看"
            android:layout_weight="1.0"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="自己写"/>
        <Button 
            android:id="@+id/btn1"
            android:text="删除"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:background="自己写"
            />
        
    </LinearLayout>谢谢谢谢,还请教一个问题,上图是怎么获取当前listview的位置的。。这个view获取要放在adapter中,然后实现popupwindow显示在这个view的下面区别只在于显示popupwindow的代码要写在adapter内部或者是将内部获取的view传参出去
    谢谢。哈哈。想起来了我的分会给分的。你那么好!还遇到了一个问题。。就是我在getview里initPopupWindow,但是convertView出错了。。上面那个提示去掉final,下面那个提示添加final
      

  10.   

    你在外面建一个View对象在里面接收一下convertview
      

  11.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="100dip"
         android:layout_height="50dip"
         android:orientation="horizontal"
         >
        <Button 
            android:id="@+id/btn"
            android:text="查看"
            android:layout_weight="1.0"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="自己写"/>
        <Button 
            android:id="@+id/btn1"
            android:text="删除"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:background="自己写"
            />
        
    </LinearLayout>谢谢谢谢,还请教一个问题,上图是怎么获取当前listview的位置的。。这个view获取要放在adapter中,然后实现popupwindow显示在这个view的下面区别只在于显示popupwindow的代码要写在adapter内部或者是将内部获取的view传参出去
    谢谢。哈哈。想起来了我的分会给分的。你那么好!还遇到了一个问题。。就是我在getview里initPopupWindow,但是convertView出错了。。上面那个提示去掉final,下面那个提示添加final
    你在外面建一个View对象在里面接收一下convertview 
      

  12.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="100dip"
         android:layout_height="50dip"
         android:orientation="horizontal"
         >
        <Button 
            android:id="@+id/btn"
            android:text="查看"
            android:layout_weight="1.0"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="自己写"/>
        <Button 
            android:id="@+id/btn1"
            android:text="删除"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:background="自己写"
            />
        
    </LinearLayout>谢谢谢谢,还请教一个问题,上图是怎么获取当前listview的位置的。。这个view获取要放在adapter中,然后实现popupwindow显示在这个view的下面区别只在于显示popupwindow的代码要写在adapter内部或者是将内部获取的view传参出去
    谢谢。哈哈。想起来了我的分会给分的。你那么好!还遇到了一个问题。。就是我在getview里initPopupWindow,但是convertView出错了。。上面那个提示去掉final,下面那个提示添加final
    还有你不用在ontouch里面处理popupwindow.dismiss()
      

  13.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="100dip"
         android:layout_height="50dip"
         android:orientation="horizontal"
         >
        <Button 
            android:id="@+id/btn"
            android:text="查看"
            android:layout_weight="1.0"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="自己写"/>
        <Button 
            android:id="@+id/btn1"
            android:text="删除"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:background="自己写"
            />
        
    </LinearLayout>谢谢谢谢,还请教一个问题,上图是怎么获取当前listview的位置的。。这个view获取要放在adapter中,然后实现popupwindow显示在这个view的下面区别只在于显示popupwindow的代码要写在adapter内部或者是将内部获取的view传参出去
    谢谢。哈哈。想起来了我的分会给分的。你那么好!还遇到了一个问题。。就是我在getview里initPopupWindow,但是convertView出错了。。上面那个提示去掉final,下面那个提示添加final
    还有你不用在ontouch里面处理popupwindow.dismiss()
    这个方式,哪里不好!
      

  14.   


    比如。。
    private View convertview;那在getView.里怎么接收。。getView还是会首先使用自己的view..
      

  15.   


    比如。。
    private View convertview;那在getView.里怎么接收。。getView还是会首先使用自己的view..在ontouch方法里面
      

  16.   


    比如。。
    private View convertview;那在getView.里怎么接收。。getView还是会首先使用自己的view..在ontouch方法里面
    为什么不建议在ontouch里面处理popupwindow.dismiss()
      

  17.   

    后面那个问题还没解决
    哪个啊?  把demo发给我,我给你调调?