There are a activity what I want to fill the screen in a phone and pop up(dialog) for a tablet.
I thought I make a layout file like this,
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="@dimen/main_layout_width" android:layout_height="match_parent">
and externalize the value of width as
in values/dimens.xml
<dimen name="tutorial_width">match_parent</dimen>
in values-xlarge/dimens.xml
<dimen name="tutorial_width">320dp</dimen>
But I can't representation 'match_parent' as dimen element. Any help? Thanks!
android:id. Resource ID. A unique resource name for the element, which you can use to obtain a reference to the ViewGroup from your application. See more about the value for android:id below.
Probably you will have to set within the include tag the properties that sets where it has to be placed: android:layout_above, android:layout_toLeftOf, etc... Use fill_parent instead. I pasted my code and I am working with honeycomb, thats why I was using match_parent. But it should work with fill_parent.
In Android, a resource is a localized text string, bitmap, layout, or other small piece of noncode information that your app needs. At build time, all resources get compiled into your application. The resources locates inside res directory of your app.
To efficiently re-use complete layouts, you can use the <include/> and <merge/> tags to embed another layout inside the current layout.
The best way I found: - instead of "match_parent" and "fill_parent" write "-1dp" - instead of "wrap_content" write "-2dp"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With