What do you mean by compile time? If you mean the layout that the Layout Editor shows, you might not always get the right results.
But, as far as I know, both ways should produce the same results. My suggestion would be to use a 9 patch image for such things. Thanks and Regards, Kumar Bibek On May 5, 9:06 pm, Alok Kulkarni <[email protected]> wrote: > Hi guys, > I am having an EditText. If i specify image for the EditText in the layout > XML file (android:background) it looks different and looks different when i > specify it at runtime > EditText et = (EditText)findViewById(R.drawable.et1); > et.setBackgroundDrawable(Main.themes.getDrawable(EDRAWABLES.EditTextBackgroundImage)); > Both codes point to the same image. When i specify the image at runtime , > the EditText leaves a margin at the top and bottom of the cursor in the > edittext which does not happen when i do it in XML. > I have attached the screenshots of both images. Top image is the one drawn > from XML and bottom one is given at runtime. > I am not getting the difference ? > Actually i am facing similar problems with other Widgets too if i change the > logic of specifying the drawable at runtime and not at compile time.. > Is this the default SDK behaviour ? > Thanks, > Alok > > -- > 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] > For more options, visit this group > athttp://groups.google.com/group/android-developers?hl=en > > EditTextProblem.JPG > 8KViewDownload -- 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] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

