2011-11-23 64 views
2
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@color/yellow" 
    android:orientation="vertical" > 
    <LinearLayout 
     android:id="@+id/progresscontent" 
     android:layout_width="266dp" 
     android:layout_height="52dp" 
     android:layout_margin="8dp" 
     android:background="@color/red" 
     android:orientation="horizontal" > 

     <ProgressBar 
      android:id="@+id/progress" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginRight="12dip" 
      android:visibility="visible" 
       android:padding="5dp" 
      style="@android:style/Widget.ProgressBar.Inverse"/> 

     <TextView 
      android:id="@+id/progressmessage" 
      style="@style/DialogText.Title" 
      android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
      android:paddingBottom="10dip" 
      android:paddingLeft="40dip" 
      android:paddingTop="10dip" 
      android:textColor="@color/codeFont" 
      android:textSize="15dip" /> 

    </LinearLayout> 

</LinearLayout> 

我正在尝试创建自己的自定义对话框,但这里存在一个问题。自定义对话边框总是显示白色,这里有什么问题。请任何帮助。在那张图中显示的边框是白色的。我应该怎么做才能从父布局保证金删除白色边框 enter image description here自定义对话框边框始终为白色

+0

只要看看这个:http://stackoverflow.com/questions/5910239/how-to-remove-border-in-custom-alertdialog –

回答

2

使用此:

Dialog dialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar); 
dialog.setContentView(R.layout.custom_progress_dialog); 
dialog.show(); 
1

删除保证金android:layout_margin="8dp"总是移动搜索与背景一起,让家长/默认背景将填补这个位置。使用填充代替

+0

我会尝试兄弟,但没有结果。 – fish40