My activity has android:windowSoftInputMode=”adjustResize” and behaves accordingly in Android 2.1: Before soft keyboard appears With keyboard However, in Honeycomb the soft keyboard does not resize my layout, it instead covers the buttons: Same behavior on both the 10 inch Galaxy tab and the Motorola Xoom. I’ve reworked my layout several times trying to get it […]
There are loads of default resources in android. I want to use the android.R.string.cancel and android.R.string.ok. I can do this in code easily enough getString(android.R.string.cancel) but how do do it in the layout.xml @string/cancel Tried a few things @android.R.string/cancel @android.string/cancel but these do not work. I’m sure I have seen this on dev tutorials, but […]
somehow fading edges seems not to work for android ics (android 4+) for own views. If I test this layout on a lower android version it paints the fading edge but not on android 4.1. <FrameLayout android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:fadingEdge=”vertical” android:focusableInTouchMode=”true” <– does not make any change android:focusable=”true” <– /> Is there any workaround?
I’ve tried to find the NumericUpDown button in Android, but failed. Do you know what the controller is called in Android – please let me know! <?xml version=”1.0″ encoding=”utf-8″?> <!– main.xml 7/22 2010 –> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” > <GridView android:id=”@+id/GridView” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:numColumns=”3″ android:verticalSpacing=”10dp” android:horizontalSpacing=”10dp” android:columnWidth=”90dp” android:stretchMode=”columnWidth” android:gravity=”center” android:background=”@color/white” > </GridView> <ButtonUpDown> <!– The […]
I’m trying to user the LayoutInfator to create a view. One of the options I’m thinking about is using the default android.R.layout files. However I’m finding it difficult to locate these files/how they look. It would be great if I could get some help in locating the source. I need to find the id’s of […]
What is the difference between setContentView(R.layout.main); and ArrayAdapter arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, sarray); What is the difference between R.layout and android.R.layout?
I’m trying to import the classes required to use the new “Navigation Drawer” from Android http://developer.android.com/design/patterns/navigation–drawer.html#ImpactOnNav DrawerLayout: http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html ActionBarDrawerToggle: http://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.html The import android.support.v4.widget.DrawerLayout cannot be resolved The import android.support.v4.app.ActionBarDrawerToggle cannot be resolved I have updated the libraries to the latest version but still these classes are not recognized.
XML file saved at res/drawable/gradient_box.xml: <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <gradient android:startColor=”#FFFF0000″ android:endColor=”#80FF00FF” android:angle=”45″/> <padding android:left=”7dp” android:top=”7dp” android:right=”7dp” android:bottom=”7dp” /> <corners android:radius=”8dp” /> </shape> (The above shape definition is is taken from then Android developer guide. There’s no errors in it.). Let’s try to use it together with a TextView: <TextView android:layout_width=”match_parent” android:layout_height=”match_parent” android:text=”Text […]
I don’t know how to get an image to fill the screen, have tried everything, maybe there is some particular layout I should be using..? I’m using an ImageView, however this just fills about 70% of the screen, leaving blank space at the bottom… At the moment i’m just using a LinearLayout and setting its […]
I open a popu window like this: mInfoPopup = new PopupWindow(layout, 400, 600, true); mInfoPopup.setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); The window then gets the exact size specified (400×600) and does NOT adjust its size to its content. What do I need to change so that the popup window will actually wrap around its contents?