apply a background to a android dialogue box
i am trying to create a basic custom dialoge view on android witha few drop down boxes and a background image.
the issue i am having is that for some reason, it always draws the dialogue box bigger than necesary and therefore, the background image doesnt cover the whole dialogue box.
Its best i show you a pic of what i mean:
Sorry, here is my xml file related to this view:
<ImageButton android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/closeButton"
android:src="@drawable/close_dialogue" android:background="@null"
android:layout_alignParentRight="true" android:layout_marginRight="10dip" android:layout_marginTop="10dip"></ImageButton>
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content" android:id="@+id/nz开发者_开发知识库bNameText"
android:text="Nzb Title" android:layout_below="@+id/closeButton" android:layout_marginLeft="10dip" style="@style/BoldBlackStyle"></TextView>
<TextView android:layout_height="wrap_content"
android:layout_below="@+id/nzbNameText" android:layout_width="wrap_content"
android:text="Catagory" android:id="@+id/catagoryLabel"
android:layout_marginTop="20dip" android:layout_marginLeft="10dip" android:textColor="@color/Black"></TextView>
<Spinner android:layout_height="wrap_content"
android:layout_below="@+id/catagoryLabel" android:layout_width="fill_parent"
android:id="@+id/catagorySpinner" android:layout_marginLeft="10dip" android:layout_marginRight="10dip"></Spinner>
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_below="@+id/catagorySpinner"
android:id="@+id/postProcessLabel" android:text="Post process"
android:layout_marginTop="10dip" android:textColor="@color/Black" android:layout_marginLeft="10dip"></TextView>
<Spinner android:layout_height="wrap_content"
android:layout_below="@+id/postProcessLabel" android:id="@+id/postProcessSpinner"
android:layout_width="fill_parent" android:layout_marginRight="10dip" android:layout_marginLeft="10dip"></Spinner>
<TextView android:layout_height="wrap_content"
android:layout_below="@+id/postProcessSpinner" android:layout_width="wrap_content"
android:id="@+id/priorityLabel" android:text="Priority"
android:layout_marginTop="10dip" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" android:textColor="@color/Black"></TextView>
<Spinner android:layout_height="wrap_content"
android:layout_below="@+id/priorityLabel" android:layout_width="fill_parent"
android:id="@+id/prioritySpinner" android:layout_marginLeft="10dip" android:layout_marginRight="10dip"></Spinner>
<Button android:layout_height="wrap_content"
android:layout_below="@+id/prioritySpinner" android:layout_width="wrap_content"
android:id="@+id/downloadButton" android:text="Download" android:layout_marginLeft="10dip" android:layout_marginRight="10dip"></Button>
i think you have to remove the TitleBox on your DialogBox. In my Dialog i use this code requestWindowFeature(Window.FEATURE_NO_TITLE);
精彩评论