Android Studio rendering issue in design view - android

When I open up my android studio, I do not see the image of any device in design view. Rather, an error shows up. I know there should be a device where we can do some drag and drop for GUI. How can this rendering problem be fixed?

You need to change the Theme. There's the AppTheme tab if you can find. Change it to something other. Many other themes are available and will have different design schemes. Choose from them. The issue will be gone

Add the resources in a library project as per http://developer.android.com/tools/support-library/setup.html
>Section > Adding libraries with resources
You then add the android-support-v7-appcompat library in your workspace and then add it as a reference to your app project.

Related

Design changes in library project of android studio does not affected

I have integrated a text-chat-sample application in my project.
I want to change the design of the text-chat layout. For this I have to change the design in text-chat library. I have changed it but the application is unaffected.
Are there any steps I need to follow in android studio?
I have checked it and tried to change the design in the library but it didn't take any changes which I have made.
So for solving this issue, I have copied all the required resources like Java class, XML files into my project.
Then I have made UI changes over there and it works perfectly.
Hope this will help you too ;)

Android Studio: My layouts are all gone. What happened?

I had several layouts for various size devices and at each orientation. Somehow, they've all disappeared and only the original layout shows again, no matter which device type or size or orientation I select in Android Studio's renderer.
I've upgraded Android Studio. I've renamed the parent folder the source project and files were in. I've upgraded the sdk. Also, Although my app is not a Gradle project, I did something the IDE kept bugging me to do... I believe I moved something from AndroidManifest to build.gradle.
I don't know which step caused me to lose my layouts, as I didn't notice as I worked on other things.
Does anyone have any idea what I might have done that would cause my layouts to disappear?
Thanks.
They have not disappeared and you have not lost them!
Click on the drop down which I have circled (It probably says Android for you) and choose "Project" view which is what you were used to before the update.

I can't see the graphical layout when I open an XML file

It shows a blank screen. I then have to click the blue/gray star icon and choose App theme, only then will elements show in the palette. I then have to drag an element from the palette onto the blank screen and drop it. Then the graphical layout will appear.
It used to work fine until I started playing around with themes and ActionbarSherlock.
I tried restoring defaults on all Android and XML settings but it didnt work.
Does anyone know how to fix it so that the XML graphical editor shows up when I open a layout XML file?
(The xml I am working with are not blank.)
Every day i face this problem, especially when I add a new Andorid Project to workspace, the only solution I found is to restart Eclipse, I hope this will help you too.
I guess your issue is Eclipse related, but try to be specific next time about your IDE since it may help you get the right answer.
If you're using Eclipse i recommend that you check that your Android SDK Tools Eclipse plug-in (ADT) is up to date.
This happens with me sometimes if I haven't chosen an android version in the top-right corner of the graphical layout editor. Because the same theme might look different in different versions of Android, I guess eclipse doesn't know what to show you unless you select a specific version of android for the theme you have chosen.
It also sometimes happens with me, If I have used a Google API's version instead of Android X.X version as target build for my project. Maybe some bug in the developer tools.
Try to increase -Xms128m -Xmx1024m when launch eclipse. I had the same problem because i don't have enough memory.
Hope this helps.
Ok, so my best understanding is that you somehow overwrote or changed the default theme for that project with something other than AppTheme. You should be able to change that in the styles xml file (ProjectPath/res/values/styles.xml), assuming this is the same project.
For reference, mine works fine, and my project's styles.xml looks like this (new project):
<resources>
<style name="AppTheme" parent="android:Theme.Light" />
</resources>
In the eclipse, right click on your XML file and choose Open With and then XML Editor
At the bottom of the page, you'll see Design and Source tabs. Click on the Source to see what you desired.
mine never refreshes. So i open up another file then return back and then it refreshes. Even if i go to the palette to refresh it was not working. Also like others mentioned make sure your your api version is application to what you want rendered. So mine was set to api 20 but my project runs on api 17 so play with it. Heres a image:
notice how mines set to 17 - yours might be at 20 or something else that differs from your manifest. change it accordingly.
Solution for andoird Studio Users.
Below solution worked for me.
File --> Invalidate Caches and Restart --> Invalidate and Restart.
Hope this will work for you too.

ActionBarSherlock app icon in wrong position

I am trying to use the rather smart ActionBarSherlock and it is going ok except for 1 rather important thing. The app icon seems to be firmly stuck in the middle of the actionbar.
I am currently deploying on 2.3.4, not using actionbar tabs and using the theme
android:theme="#style/Theme.Sherlock"
Everything works fine except for this. I have also tried it on the emulator.
Any suggestions?
Solved I was stupidly not telling Eclipse that I was designing using android 3.2 or higher.
This messed up the appearance of the actionbar when built.
I also found it essential to build the sherlock library from the downloaded zip file outside my workspace.

How to control the RELATIVE path of a reference Library Project?

I am trying to add the LVL library project to my application's project. It should be simple and straightforward, but it isn't:
When I click the Add... button, I receive the Library Project Selection dialog as expected:
I select it and it is being accepted with the green checkmark next to it.
However, when I re-open that Properties > Android box again, it gets a red X next to it, making it unusable:
There is an excellent answer documenting the "delicate behavior" of referencing a library project, but despite implementing the tips there (same root directory), I am still having this problem.
How do I solve (or workaround) this problem?
Is there a way to make Eclipse/ADT use fewer..\..s to represent the path of the referenced library project? (all is needed to reference that library correctly is ..\..\thisisinsane\library, there really is no need for all that ..\..\..\..\..\..)
I solved the problem by following the excellent steps in this answer.
In essence, The Eclipse+ADT duo doesn't "like" projects that aren't in the workspace, regardless whether these are application projects or library projects (even if Google created them).

Categories

Resources