How to Copy/Paste views in Component tree in Android Studio IDE - android-studio

I can't figure out how to copy a single view, or whole table row (basically no type of view).
When I right click any of the views in the figure below, there is copy option. But I never get the paste option. Keyboard Ctrl+C/Ctrl+V does not work either.
I googled for a while, but nothing seems to answer my problem. The closest related post I found is this.
So is this Copy/Paste bug spread over most of the GUI designer of AS, or what am I doing wrong ?
Android Studio 2.2.2. # Ubuntu 14.04

We can always copy/paste in text mode. Seems like that is only solution left for now. And works fine..

This might be a bug with Android Studio.
https://code.google.com/p/android/issues/detail?id=228677

I hold CTRL key then click the view which I want to copy then release.
I found that in https://code.google.com/p/android/issues/detail?id=228677
that Alex Leonov shared
here is a photo
android 2.2 component tree copy and paste

Related

Android Studio isn't showing the xml editor [duplicate]

How can I enable the text/design Tab on the a src/main/res/layout folder on the activity_main.xml file that was created automatically during create new project? If i do right click and create xml file on the said folder, the design/text tab exist. Any suggestion? Thanks.
No Text/Design Tab on the Bottom Part of the Android Studio
Creating a new XML in the Res/Layout Folder, the design/text tab is now present.
Any help? this is super weird guys...
In Android Studio 3.6 use these three buttons (Code | Split | Design), on top right, to switch between views.
I had the same problem, restarting the IDE did make that tab appear again.
On Android Studio 3.6.1
Top Right corner under the main toolbar you have three different icons (Code, Split, Design).
View -> Tool windows -> Preview .
Output view:
use the three buttons (Code|Split|Design)on top right hand side to switch between views.
I also had this problem after upgrading to 1.5. None of the above suggestions worked for me. I noticed that the default relative layout xml has changed with a third xmlns line and an app behavior line. I opened an older project and copied the old relative layout header to replace the new. Instantly the preview function was restored.
You can also Move between Design / Text tabs in layout’s view with simple shortcut:
(Mac) : control + shift + ← / →
(Windows / Linux): alt + shift + ← / →
On the top right corner of the activity_main.xml file view, there are 3 icons representing "Code", "Split" and "Design". Click on the leftmost icon of the three ("Code") for the text tab.
In the android Studio window, at the left side there are two options available(Project and Resource Manager). Go to resource and there you will see an ADD Module option, click on that. After this you will see your text and design option will get enabled, you can go to your work area by Project Name->app ->src ->main->res ->layout.
Yes, Even I had the same problem. For the first time... I think It wont show, restarting the IDE did make that tab appear again.
I had this problem too, I deleted all the preference files, such as the AndroidStudioPreview folder & com.google.android.studio.plist, then restarted android studio, it worked.
You do not need to restart an IDE. All you need is to close an xml file that does not get a tab and reopen it within an editor. It is a little bug.
Navigate to activity_main.xml tab then Design and Text tab appears.
It doesn't appear in MainActivity.java tab.
You do not need to restart IDE.
If text/design tab is missing in new android studio, this can solve by two methods.
You have re-install android studio. And don't forget to delete android studio related all files from temp and local.
Or you can re-install SDK (software development kit) according to your device.

visual layout editor does not allow drag&drop

I'am a newby in android studio and learning a lot, but now have a problem where i cannot seem to find the answer to.
In android studio you can visualy drag&drop your screen.
I have seen it can do al lot (although you sometimes need the xml) but for me it is not working at all.
I mean i cannot drag&drop any widgets on the screen at all.
Tried changing the theme: no help (really tried a lot of them)
Tried a complete new project: same story
Tried other APK verion: same story
Tried Invalidatd caches / restart: no help
Even with a new project (EmptyActivity) it add's a android.support.v4.widget.NestedScrollView and then gives error's on that
(Failed to find style 'coordinatorLayoutStyle' in current theme).
It also gives an error on layout_height/layout_with not being there. But they are there for each widget.
Please do not missunderstand: when i execute the project i runs just fine (both on phone and emulator) but the visual builder for the screen.....:-(
Does somebody knows how to solve this.
If more info is needed please ask.
Any help is more than welcome.
There are several things that could be causing this:
Your caches could be messed up. Try going to
File > Invalidate Caches / Restart ... (I know that you already tried this, but posting for future views.)
Also, make sure that you don't have Drag-n-Drop with ALT pressed only checked in your Settings (Appearance & Behavior - Appearance).
Finally, in a default project created in Android Studio, there are two XML files created for each layout. For example, content_main.xml is embedded within activity_main.xml. Make sure that you are using content_main.xml for your design work.
In the end i fixed it by changing the SDK version in de gradle file.
still do not understand why it was wrong as studio genereded it that way but now it works so.... for me: case closed.

Copy-paste is not working in Android Studio on Mac

I am facing a weird issue with Mac version of Android Studio (i.e., I am not able to copy (⌘ + C) and paste (⌘ + V) any text). I have no idea why it is behaving strange like this. My question may be silly, but I have been facing this issue since I started working from Windows to Mac. Any solutions and alternatives would be much helpful for me. I am completely stuck with this issue for the past two days.
There are several reasons why you could be experiencing this
You are using ClipMenu and Android studio doesn't like it
Your keybinding is messed up.
To solve keybinding issue press File -> Settings and check what the keybindings are, you have maybe changed it or imported settings from somebody else. See the image as a reference.
Note: the filter of copy, you need to do this for paste too.
To fix the issue with ClipMenu.
Right click on "Application/IntelliJ IDEA 14.app"
choose "Show Package Contents"
edit bin/idea.properties
add this property ide.mac.useNativeClipboard=True
restart IntelliJ IDEA.
There is a YouTrack issue with further information
this worked for me
go to file menu and click on invalidate Caches/Restart ,after this confirm the dialog open .
Go to File-> Setting->Editor(Under IDE Settings)->Change value of maximum number of contents to keep in clipboard to 1(Under Limits section)
I have this issue due to PopClip I have to disable it to get the keyboard shortcuts working.
Check that your keymaps aren't messed up. Go to Android Studio > Preferences > Keymap > Main Menu > Edit. If copy and paste are set correctly there, then it must be something else in your system that's stopping it
I got this bug with my ClipMenu (on Mac) while set useNativeClipboard=true.
I solved the problem by using ClipMenu to paste file into Android Studio (show menu of ClipMenu, then select item)
In my case, the Ctrl c is occupied by other programs(my case is "Oulu Dictionary" program).
Try to check if other programs have global shortcut keys.
disable the plugin Ideavm if installed under settings>plugins>installed.

Connection between Xcode and MonoDevelop broken?

I'm a new user and yesterday had a basic master/detail app working correctly, using a table view with dynamic cells. But after a bit of editing the link between the Xcode storyboard and MonoDevelop seems partially broken. I am making changes in the style of the table view cells (e.g. adding or removing accessories, changing the style from 'Basic' to 'Left Detail'), but none of these changes have any affect when I run the code. More importantly when I run the app the cells are static, not dynamic content as shown in Xcode.
I have checked the content of the storyboard in XML format in MonoDevelop and that is changing as expected.
Not everything in the connection is broken, e.g. if I add a button to the navigation bar this is showing up correctly when I run the app.
Help please!
After more experimentation (and having to rebuild my storyboard from scratch) I believe I have found a bug in MonoDevelop. It's reproducible like this:
Take a simple working app (I used the 'tasky' sample) and open the storyboard.
In Xcode, delete the table view cell from the Root View Controller Table View.
Think "oops, I didn't want to delete that" so close Xcode without saving (I used the red 'LED' button for this) - this appears to be a bug in Xcode not MonoDevelop, in that there isn't a prompt to ask if I want to save before closing.
Open the storybaord again from the MonoDevelop solution view - the table view cell is still deleted - surely it shouldn't be because Xcode wasn't saved.
Now try to add the cell again, exactly as it was before. Even though it looks perfectly correct in Xcode, with a correct segue and marked as a prototype cell, it will not work correctly when the code is run.
Furthermore, if you add some code so that a basic cell is returned by GetCell (because DequeueReusableCell won't return a cell now) the format of the cell in the detail view is just stuck - changing its style to 'Right Detail' etc has no effect in the app when it is run, although it looks perfectly OK in XCode.
Now, I know it's all too easy for new users to think they have found bugs in code when in fact it's just being misused in some way. So it would be good if someone else could check my findings before I report this to Apple and/or Xamarin. If I'm correct it's a serious bug because the only solution I have found, if you don't have source-code control of some kind, is to rebuild your storyboard from scratch.
Thanks

When I drag and drop my user control onto the design surface, it is showing up as a LINK?

Has anyone seen this. Ive done this before and its not been a problem, but now I am trying to drag and drop and it keep showing the files location in a link... ?
In Visual Studio, I have seen this happen when you drag a UserControl onto the Source view of an ASP.Net .aspx page. Be sure you are dragging the UserControl onto the Design surface.
Edit: This fellow was able to solve his problem by reinstalling Visual Studio. Not a happy thought, but if you're using a recently-installed version, it might be worth a try.

Resources