On Tue, Mar 25, 2008 at 2:43 AM, vitvikt <[EMAIL PROTECTED]> wrote:

>
> Thanks, Megha
> I was very glad to get your answer.
> But your examle did not solve the problem.
>
> 1. In this example first button occupies 75% of the
> space and the other one occupies 25% in HWGA screen.
> In QVGA-P screen first button occupies 66% of the
> space and the other one occupies 33%.
> I changed layout_weight for both buttons, but could't get 9/1.
> I think that in this way I can not get button with height less then
> fix value.


The QVGA-L and QVGA-P modes are not supported in the m5 SDK. Your
application may still use them, but may face some issues with layout.
It is recommended  to use HVGA-L and HVGA-P modes.


>
> 2. I got  9/1 only when I set layout_height for second button near
> 15px.
> But in this case it is nessary to have possibility change this value
> programatically.


You can set the layout_height programatically using the LayoutParams class.
http://code.google.com/android/reference/android/widget/LinearLayout.LayoutParams.html

button.setLayoutParams(new
LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT));



>
> 3. In my project I have (in LinearLayout with vertical orientation)
> Picture, horizontal ProgressBar and 5 buttons.
> I insert each of them in separate LinearLayout and set  layout_weight
> for each of LinearLayout 0.8   :0.1. : 0.1
> LinearLayout for buttons has orientation="horizontal" and I set for
> each of fife buttons layout_weight=0.2
> But in result first button have width less then another. Do you know
> what is a reason?


I am not sure, what is the layout_width on these buttons?


> 4. Yesterday, before I got your answer, I try do all programatically.
> I solve problem with Picture and buttons, but I couldn't set style="?
> android:attr/progressBarStyleHorizontal" for  ProgressBar. Is all so
> sofisticated in Android SDK or it's only my problem?
> All examples in ApiDemo use only xml layouts, so little explains in
> docs and decisions are not obvious.


In xml you could use :

 <ProgressBar android:id="@+id/progress"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="200dip"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:max="100"
            android:progress="34" />


 If you want to do this programatically, try using the constructor:

 ProgressDialog pd = new ProgressDialog(this,
android.R.styleable.Theme_progressBarStyleHorizontal);



>
> Regards,
> Vitaly
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to