android - Button below listView in DialogFragment -


I am trying to list a list code containing the list in the list and a button below that list view. The button should always appear, this means that you can scroll through the ListView but the button always looks.

The dialog should also adjust its height, which means that if there are only a few elements (1 or 2 elements) in the list view, DialogFragment should not fill the entire height of the screen ...

This is my code:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" & gt; & Lt; LinearLayout android: orientation = "vertical" android: padding = "@ Dimen / fragment_default_padding" Android: Layout_width = "Match_parent" Android: Layout_height = "Wrap_content '& Gt; & Lt; imageView Android: layout_width = "40dp" Android: layout_height = "40dp" android: src = "@ drawable / BACK_ARROW" android: id = "@ + id / imgBack" / & gt; & Lt; TextView android: text = "@ string / this_pizzeria_require_a_phone_number_inorderto_accept_orders" Android: Layout_width = "Match_parent" Android: Layout_height = "Wrap_content" style = "@ style / default_title" / & gt; & Lt; EditText Android: layout_width = "match_parent" Android: layout_height = "wrap_content" android: id = "@ + id / edtPhoneNumber" Android: layout_marginBottom = "4dp" Android: singleLine = "true" Android: imeOptions = "actionDone" android: hint = "@ String / select_from_the_below_list_or_insert_a_new_one_here" Android: inputType = "phone" /> & Lt; ListView android: id = "@ + id / lvPhones" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" Android: layout_above = "@ + id / btnAdd" Android: dividerHeight = "1DP" / & gt; & Lt; Button Android: ID = "@ + ID / BTN Dawn" Android: Text = "@ string / full" style = "@ style / default_button" /> & Lt; / LinearLayout & gt; & Lt; / RelativeLayout & gt;  

This code works fine, but if there are many things in the list view, the buttons below disappear. This is a screen of the dialog: Enter image details here

As you can see

What is the way to achieve my goal?

Thanks a lot!

The more I pay attention to your layout individually. I think you should do it a bit better in your linear rhythm. However, whenever I am facing this problem, I

  android: layout_weight = "1"  

and it is usually solved is.

  & lt; Android: ID = "@ + ID / BTN Dawn" Android: Text = "@ String / Full" Android:  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -