当前位置: 代码迷 >> Android >> 这个布局如何写
  详细解决方案

这个布局如何写

热度:76   发布时间:2016-04-28 07:15:57.0
这个布局怎么写
做一个类似手机qq的那种popupWindow,遇到了一些麻烦,那个文字的背景怎么才能填充到一半,


popupwindow android

------解决方案--------------------
引用:
做一个类似手机qq的那种popupWindow,遇到了一些麻烦,那个文字的背景怎么才能填充到一半,



<?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>
------解决方案--------------------
你的思路没问题啊,popupwindow里面自己布局,做两个控件分别给不同的背景图片
------解决方案--------------------
引用:
你的思路没问题啊,popupwindow里面自己布局,做两个控件分别给不同的背景图片

是的呀
------解决方案--------------------
引用:
Quote: 引用:

Quote: 引用:

做一个类似手机qq的那种popupWindow,遇到了一些麻烦,那个文字的背景怎么才能填充到一半,



<?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的下面
------解决方案--------------------
引用:
Quote: 引用:

Quote: 引用:

Quote: 引用:

做一个类似手机qq的那种popupWindow,遇到了一些麻烦,那个文字的背景怎么才能填充到一半,



<?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="查看"
  相关解决方案