How to add to HorizontalScrollView - android-studio

I have in my xml file, an empty HorizontalScrollView.
how do I add a picture to the HorizontalScrollView through the Java file.

plese refer this example
add scrollview inside dynamic view
https://www.dreamincode.net/forums/topic/130521-android-part-iii-dynamic-layouts/

Related

How can I add attributes to the codesample pre block that is created by tinymce

I have a TLDR switch on my blog.
This switch is a javascript that hides any element with the class="tldr" attribute attached to it, or unhides it.
I've created custom block_formats in TinyMCE for Paragraphs that will let me create a Paragraph with the TLDR class attached.
However, when I insert a codesample using that plugin it will generate a pre block that I can not format afterward.
I've already tried to create a custom PRE block with the TLDR class but TinyMCE won't let me apply this format to the code sample block that has been created.
Does anyone have another solution for my problem or can you see if I'm doing anything wrong?
Is there another way in TinyMCE to add attributes to elements that have been added to the code already?
I've tried the code viewer but that doesn't allow me to modify the generated HTML code.
You can use formats and style_formats to customize the styling options available to users and how they operate.
To add a custom pre block with class="tldr", you can add this config to TinyMCE:
style_formats: [
// Adds a pre format to style_formats that applies a 'tldr' class
{ title: 'TLDR', block: 'pre', classes: 'tldr' }
]
See this TinyMCE fiddle: http://fiddle.tinymce.com/Ikhaab
On its own, this will override the default style formats, but you can add them back in and position the new TLDR option within the Blocks submenu as shown here: http://fiddle.tinymce.com/Jkhaab
Resources:
https://www.tiny.cloud/docs/configure/editor-appearance/#style_formats
https://www.tiny.cloud/docs/configure/content-formatting/#formats
https://www.tiny.cloud/docs/demo/format-custom/

Orchard.Layouts: How do you generate the "code" for a layout?

Using 1.9-int branch of Orchard.
In PageCommand.cs (Orchard.Pages) there is the following code:
layout =
"{\"elements\": [{" +
"\"typeName\": \"Orchard.Layouts.Elements.Canvas\"," +
. . . .
When going to a Layout I created, I see no ability to get this code.
If I attach the Layout Part to a custom Content Type, there is a text area for the "default layout" which also has this element definition. So it seems I can change the definition in here, but again where can I generate it from a Layout I create?
Where can I generate this? I'd like to create a Command file to use in a Recipe and have it use a particular layout.
Thanks.
Did not realize that a simple Export of the Layout would provide the exact code that I needed.

How can I specifiy an alternate layout for NotFound.cshml and ErrorPage.cshtml in Orchard CMS

I know you can use layout filters for normal pages with urls, but upon errors the view changes while keeping the url the same, so I can't utilize a new layout based on the path. Any help would be appreciated. Thank you!
Off the top of my head:
If you look in Core > Shapes > Views, you will see two files - one called ErrorPage.cshtml and one called NotFound.cshtml. Simply copy these files and paste them into your theme's view folder.
I have not tested this method with these particular pages, but I did do something similar with the LogOn widget.
Something to bear in mind is that the contents of these files will be rendered in the Content zone of your current theme.

How to work with a classpath resource in FXML to stay compatible with SceneBuilder?

When i'm using an image in my FXML code like this...
<Image url="#/de/myprj/assets/icons/arrow.png" />
...everything goes fine until the moment when i want to edit the FXML file in SceneBuilder. How can i use such resources within FXML with SceneBuilder?
It is far safer to set the image using CSS, either in scene builder or preferably in a stylesheet specific to your app.
Checkout: http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#imageview
edit:
Create a css file, load it into the scene's css files when you start your application.
scene.getStylesheets().add(new File("mycss.css").toURI().toString());
In your CSS file add the following:
.the-image {
-fx-image: url("theimage.png");
}
Make sure there is a file called theimage.png in the same directory as your css file. In scenebuilder, click on the ImageView. In the box that is labeled "Style Class" add the string the-image.
Voila.

SP2010 Content Editor: add text to paragraph by default

Is there a way to make the Content Editor (RichHtmlField) in SP2010 add newly inserted text to a paragraph (with the default paragraph style ms-rteElement-P). I have changed said css class to how I want the body text to be formatted and I want to eliminate the step of selecting the Markup Styles -> Paragraph style manually when a user starts to add content.
There is no out-of-the-box way, but you could use JavaScript to always add default content to any content editor on a page. Another way would be to create your own WebPart deriving from the Content Editor WebPart, but that sure is a lot more work.
I got an answer here: http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/65152576-9432-4d55-a2e1-c798975859d5
Hi,
You have to override the PrefixStyleSheet property of the RichHtmlField control.
Here is some more information about that: http://msdn.microsoft.com/en-us/library/ms551040.aspx
Hope this helps!
Regards, Sjoukje

Resources