Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-09 Thread Trupti Dalia
Justin, Felipe, none of those also worked. Finally I created a new xml layout for 2 items or for more items and set height in the XML with more than 2 items and it got working as I want. As AlertDialog always starts from center screen, so using getWindow().setAttributes(), I set the "y" & "Gravity

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-06 Thread Felipe Caldas
> > Is your inflated layout a LinearLayout ? If not, try with LinearLayout. Another possibility is dialog = new Dialog(this,android.R.style.Theme_Translucent_NoTitleBar); dialog.setContentView(R.layout.custom_dialog); LayoutParams lp=dialog.getWindow().getAttributes();

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-06 Thread Justin Anderson
Try doing this: Got it from here: http://stackoverflow.com/questions/4300170/listview-ignoring-wrap-content Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Thu, Sep 6, 2012 at 6:09 AM, tvdalia wrote: > > Calin, > > Made LineatLayout layout_hei

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-06 Thread tvdalia
Calin, Made LineatLayout layout_height - 150dp & ListView's height = match_parent. Unfortunately, no success. Infact the result was same as shown above. Also tried ListView height as wrap_content, both show same results as show above. http://schemas.android.com/apk/res/android";

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-06 Thread Calin Perebiceanu
Hard code the LinearLayout's height, not the ListView On Thursday, 6 September 2012 09:39:19 UTC+3, tvdalia wrote: > > > Calin, hardcoding my ListView layout_height="200dp" gave the results. // > 100dp was too small so made 200 > > But I use the method to create various items of List - their mayb

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-05 Thread tvdalia
Calin, hardcoding my ListView layout_height="200dp" gave the results. // 100dp was too small so made 200 But I use the method to create various items of List - their maybe just 2 items or 20. If I made it 200dp, then the list that has just 2 items was shown big with extra space below. If I mad

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-05 Thread Calin Perebiceanu
Use layout_height="100dp" in the layout xml -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr..

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-05 Thread Justin Anderson
WRAP_CONTENT will make your height depend of the number of items you have > in the list.You should use a hard coded layout_height > This is true (I should have thought of that). But, if you have a listview with lots of items WHY do you not want the dialog to take up as much room as it needs to? T

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-05 Thread tvdalia
Calin, For hard coded layout_height, how to figure out that. I can have the MainBody's height, but how do I set it as hard coded something like "300dp" or so. I believe I will have to do that in createAlertDialog() - due to different screen sizes, right. I gave this line in method belo

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-04 Thread Calin Perebiceanu
Hi , WRAP_CONTENT will make your height depend of the number of items you have in the list. You should use a hard coded layout_height On Wednesday, 5 September 2012 09:19:38 UTC+3, tvdalia wrote: > > > Justin, I changed in xml layout_height of both LinearLayout & ListView as > "wrap_content" in

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-04 Thread tvdalia
Justin, I changed in xml layout_height of both LinearLayout & ListView as "wrap_content" instead of "match_parent. But also same results. This is the way I have coded for that layout to create a dialog : public AlertDialog createAlertDialog(String title, String[] items, > OnItemClickListe

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-04 Thread Justin Anderson
Change this: android:layout_height=*"match_parent" *to this: android:layout_height=*"wrap_content"* Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Tue, Sep 4, 2012 at 5:46 AM, tvdalia wrote: > > Thanks for your prompt response. > > In the xml, I ha

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-04 Thread tvdalia
Thanks for your prompt response. In the xml, I have already given android:layout_height="match_parent' of its LinearLayout & of List too. > > > http://schemas.android.com/apk/res/android"* > * *android:layout_width=*"match_parent"* android:layout_height=* > "match_parent"** *android:orienta

Re: [android-developers] How to set height of a custom developed AlertDialog ?

2012-09-04 Thread ramesh aravelli
Set height attribute for xml which u r going to show in dialog On Sep 4, 2012 4:18 PM, "tvdalia" wrote: > > Hello, > > I create a custom AlertDilaog using inflate Layout. It uses all the > space it can. I want it to restrict the height. My Activities have differnt > part : > MainBODY > Footer

[android-developers] How to set height of a custom developed AlertDialog ?

2012-09-04 Thread tvdalia
Hello, I create a custom AlertDilaog using inflate Layout. It uses all the space it can. I want it to restrict the height. My Activities have differnt part : MainBODY Footer Thier is a ParentActivity that has a standard footer and in other activities I inflate the ViewGroup in the