How to use HorizontalScrollView - horizontalscrollview

Hey guys I am new to android designing phase hope you people can help me with the problem.I created 4 HorizontalScrollView but i am able to access(Move) only the last view.I am not able to access(Move) 1st 2nd and 3rd HorizontalScrollView.I have provided the code below for your reference
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff4952"
tools:context=".MainActivity">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/layout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="150dp"
android:background="#000000"
android:orientation="horizontal"
android:padding="8dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
</LinearLayout>
</HorizontalScrollView>
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="300dp"
android:background="#000000"
android:orientation="horizontal"
android:padding="8dp"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
</LinearLayout>
</HorizontalScrollView>
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="450dp"
android:background="#000000"
android:orientation="horizontal"
android:padding="8dp"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
</LinearLayout>
</HorizontalScrollView>
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="600dp"
android:background="#000000"
android:orientation="horizontal"
android:padding="8dp"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:src="#drawable/aaaa" />
</LinearLayout>
</HorizontalScrollView>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
Thanks and regards

Related

ContentControl.insertOoxml adds extra paragraphs

I am trying to add to my Word document a new content control with a table inside. I have the Ooxml of the table and I am inserting this to a new content control with insertOoxml. But it is adding a new paragraph before the table and another one after it, as shown in the following image.
This is my code:
Word.run(function (context) {
var range = context.document.getSelection();
var myContentControl = range.insertContentControl();
myContentControl.title = "ZZZ";
myContentControl.insertOoxml(dataXml, 'end');
myContentControl.cannotEdit = false;
myContentControl.cannotDelete = false;
context.load(myContentControl, 'id, title, tag');
return context.sync().then(function () {
console.log("Success");
});
});
This is the main part of dataXml content:
<?mso-application progid="Word.Document"?>
<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">
<!-- ... -->
<pkg:part pkg:name="/word/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml">
<pkg:xmlData>
<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://purl.oclc.org/ooxml/officeDocument/relationships" xmlns:m="http://purl.oclc.org/ooxml/officeDocument/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://purl.oclc.org/ooxml/wordprocessingml/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 wp14" w:conformance="strict">
<w:body>
<w:tbl>
<w:tblPr>
<w:tblStyle w:val="table" />
<w:tblW w:w="95.25pt" w:type="dxa" />
<w:tblInd w:w="0.8pt" w:type="dxa" />
<w:tblCellMar>
<w:top w:w="0pt" w:type="dxa" />
<w:start w:w="0pt" w:type="dxa" />
<w:bottom w:w="0pt" w:type="dxa" />
<w:end w:w="0pt" w:type="dxa" />
</w:tblCellMar>
<w:tblLook w:firstColumn="1" w:firstRow="1" w:lastColumn="1" w:lastRow="1" w:noVBand="1" />
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="952" />
<w:gridCol w:w="953" />
</w:tblGrid>
<w:tr>
<w:tblPrEx>
<w:tblW w:w="95.25pt" w:type="dxa" />
<w:tblInd w:w="0.8pt" w:type="dxa" />
<w:tblCellMar>
<w:top w:w="0pt" w:type="dxa" />
<w:start w:w="0pt" w:type="dxa" />
<w:bottom w:w="0pt" w:type="dxa" />
<w:end w:w="0pt" w:type="dxa" />
</w:tblCellMar>
<w:tblLook w:firstColumn="1" w:firstRow="1" w:lastColumn="1" w:lastRow="1" w:noVBand="1" />
</w:tblPrEx>
<w:trPr>
<w:trHeight w:hRule="exact" w:val="288" />
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="48.75pt" w:type="dxa" />
<w:tcBorders>
<w:top w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:start w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:bottom w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:end w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
</w:tcBorders>
<w:shd w:val="clear" w:color="auto" w:fill="FFFFFF" />
<w:noWrap />
<w:tcMar>
<w:top w:w="0.4pt" w:type="dxa" />
<w:start w:w="0.4pt" w:type="dxa" />
<w:bottom w:w="0.4pt" w:type="dxa" />
<w:end w:w="0.4pt" w:type="dxa" />
</w:tcMar>
<w:vAlign w:val="bottom" />
<w:hideMark />
</w:tcPr>
<w:p>
<w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri" w:cs="Calibri" />
<w:b w:val="0" />
<w:bCs w:val="0" />
<w:i w:val="0" />
<w:iCs w:val="0" />
<w:smallCaps w:val="0" />
<w:color w:val="000000" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri" w:cs="Calibri" />
<w:b w:val="0" />
<w:bCs w:val="0" />
<w:i w:val="0" />
<w:iCs w:val="0" />
<w:smallCaps w:val="0" />
<w:color w:val="000000" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
<w:t>A</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="48.75pt" w:type="dxa" />
<w:tcBorders>
<w:top w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:start w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:bottom w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:end w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
</w:tcBorders>
<w:shd w:val="clear" w:color="auto" w:fill="FFFFFF" />
<w:noWrap />
<w:tcMar>
<w:top w:w="0.4pt" w:type="dxa" />
<w:start w:w="0.4pt" w:type="dxa" />
<w:bottom w:w="0.4pt" w:type="dxa" />
<w:end w:w="0.4pt" w:type="dxa" />
</w:tcMar>
<w:vAlign w:val="bottom" />
<w:hideMark />
</w:tcPr>
<w:p>
<w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri" w:cs="Calibri" />
<w:b w:val="0" />
<w:bCs w:val="0" />
<w:i w:val="0" />
<w:iCs w:val="0" />
<w:smallCaps w:val="0" />
<w:color w:val="000000" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri" w:cs="Calibri" />
<w:b w:val="0" />
<w:bCs w:val="0" />
<w:i w:val="0" />
<w:iCs w:val="0" />
<w:smallCaps w:val="0" />
<w:color w:val="000000" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
<w:t>B</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<w:tr>
<w:tblPrEx>
<w:tblW w:w="95.25pt" w:type="dxa" />
<w:tblInd w:w="0.8pt" w:type="dxa" />
<w:tblCellMar>
<w:top w:w="0pt" w:type="dxa" />
<w:start w:w="0pt" w:type="dxa" />
<w:bottom w:w="0pt" w:type="dxa" />
<w:end w:w="0pt" w:type="dxa" />
</w:tblCellMar>
<w:tblLook w:firstColumn="1" w:firstRow="1" w:lastColumn="1" w:lastRow="1" w:noVBand="1" />
</w:tblPrEx>
<w:trPr>
<w:trHeight w:hRule="exact" w:val="288" />
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="48.75pt" w:type="dxa" />
<w:tcBorders>
<w:top w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:start w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:bottom w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:end w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
</w:tcBorders>
<w:shd w:val="clear" w:color="auto" w:fill="FFFFFF" />
<w:noWrap />
<w:tcMar>
<w:top w:w="0.4pt" w:type="dxa" />
<w:start w:w="0.4pt" w:type="dxa" />
<w:bottom w:w="0.4pt" w:type="dxa" />
<w:end w:w="0.4pt" w:type="dxa" />
</w:tcMar>
<w:vAlign w:val="bottom" />
<w:hideMark />
</w:tcPr>
<w:p>
<w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri" w:cs="Calibri" />
<w:b w:val="0" />
<w:bCs w:val="0" />
<w:i w:val="0" />
<w:iCs w:val="0" />
<w:smallCaps w:val="0" />
<w:color w:val="000000" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri" w:cs="Calibri" />
<w:b w:val="0" />
<w:bCs w:val="0" />
<w:i w:val="0" />
<w:iCs w:val="0" />
<w:smallCaps w:val="0" />
<w:color w:val="000000" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
<w:t>C</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="48.75pt" w:type="dxa" />
<w:tcBorders>
<w:top w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:start w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:bottom w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
<w:end w:val="single" w:sz="6" w:space="0" w:color="B6B6B6" />
</w:tcBorders>
<w:shd w:val="clear" w:color="auto" w:fill="FFFFFF" />
<w:noWrap />
<w:tcMar>
<w:top w:w="0.4pt" w:type="dxa" />
<w:start w:w="0.4pt" w:type="dxa" />
<w:bottom w:w="0.4pt" w:type="dxa" />
<w:end w:w="0.4pt" w:type="dxa" />
</w:tcMar>
<w:vAlign w:val="bottom" />
<w:hideMark />
</w:tcPr>
<w:p>
<w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri" w:cs="Calibri" />
<w:b w:val="0" />
<w:bCs w:val="0" />
<w:i w:val="0" />
<w:iCs w:val="0" />
<w:smallCaps w:val="0" />
<w:color w:val="000000" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri" w:cs="Calibri" />
<w:b w:val="0" />
<w:bCs w:val="0" />
<w:i w:val="0" />
<w:iCs w:val="0" />
<w:smallCaps w:val="0" />
<w:color w:val="000000" />
<w:sz w:val="22" />
<w:szCs w:val="22" />
</w:rPr>
<w:t>D</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</w:tbl>
<w:p />
<w:sectPr>
<w:pgMar w:header="708" w:footer="708" />
<w:cols w:space="708" />
</w:sectPr>
</w:body>
</w:document>
</pkg:xmlData>
</pkg:part>
<!-- ... -->
</pkg:package>
I manage to remove the first extra paragraph with this code:
var paragraphs = myContentControl.paragraphs;
context.load(paragraphs, 'items');
return context.sync().then(function () {
paragraphs.items[0].delete();
return context.sync().then(function () {
console.log("Success");
});
});
But if I try to remove the last paragraph as in the following line, it removes the content control and doesn't delete the extra paragraph.
paragraphs.items[paragraphs.items.length - 1].delete();
How can I delete the last extra paragraph using Office.js and without removing the content control?
In all "modern" versions of Word (modern = versions that support text wrapping / free positioning of tables on the page) a paragraph following the table is required.
The paragraph mark is visible in the Word Open XML in the question:
</w:tbl>
<w:p />
<w:sectPr>
So it will not be possible to delete this paragraph.
It should be possible, however, to format it with a very small font size (as I recall, Word supports .5 pt as the minimum size) with no Space Before or Space After.
Background as to why the paragraph mark is needed: Word stores the placement information of the table on the page, as well as some other structural information "in" the paragraph mark. We can't see it, but it's what's happening "under the covers". Very similar to a Shape object's Anchor.
I found this workaround: insert directly to the document selection an Ooxml string containing also the content control and the table without paragraphs inside it.
So, this is the code:
Word.run(function (context) {
context.document.getSelection().insertOoxml(dataXml, 'Start');
return context.sync().then(function () {
console.log("Success");
});
});
This is the main part of dataXml content:
<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">
<!-- ... -->
<pkg:xmlData>
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:body>
<w:sdt>
<w:sdtPr>
<w:alias w:val="ZZZ"/>
<w:id w:val="0"/>
</w:sdtPr>
<w:sdtEndPr/>
<w:sdtContent>
<w:tbl>
<!-- ... TABLE CONTENT ... -->
</w:tbl>
</w:sdtContent>
</w:sdt>
</w:body>
</w:document>
</pkg:xmlData>
</pkg:part>
</pkg:package>
And this is the result:
At least tha last paragraph is outside the content control.

Insert Hyperlink button not visible in Word CustomUI

I have created the following XML for our Word CustomUI:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab idMso="TabHome">
<group idMso="GroupFont" visible="false" />
<group idMso="GroupParagraph" visible="false" />
<group idMso="GroupInsertTables" insertBeforeMso="GroupStyles" />
<group id="CustGrp1" label="Next" insertBeforeMso="GroupStyles">
<toggleButton idMso="AlignLeft" showLabel="false" />
<toggleButton idMso="AlignCenter" showLabel="false" />
<toggleButton idMso="AlignRight" showLabel="false" />
<button idMso="IndentDecreaseWord" showLabel="false" />
<button idMso="IndentIncreaseWord" showLabel="false" />
<gallery idMso="MultilevelListGallery" showLabel="false" />
<gallery idMso="FontColorPicker" showLabel="false" />
<gallery idMso="ShadingColorPicker" showLabel="false" />
<toggleButton idMso="Superscript" showLabel="false" />
<button idMso="SpellingAndGrammar" showLabel="false" />
<splitButton idMso="TableBordersMenu" showLabel="false" />
<button idMso="SymbolsDialog" showLabel="false" />
<button idMso="HyperlinkInsert" showLabel="true" />
<gallery idMso="AutoTextGallery" showLabel="true" />
<button idMso="BookmarkInsert" showLabel="true" />
<button id="ReferenceInsert" label="Referentie" imageMso="CrossReferenceInsert" onAction="modCode.ButtonOnAction" />
<button idMso="ReviewNewComment" showLabel="false" />
<toggleButton idMso="ParagraphMarks" showLabel="false" />
</group>
</tab>
</tabs>
</ribbon>
The HyperlinkInsert button is not visible. Does anybody know what I am doing wrong?
screenshot CustomUI

error when I use ArrayList in fxml

<children>
<fx:define>
<ArrayList fx:id="buttons">
<Button fx:id="btn1" layoutX="93.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
<Button fx:id="btn2" layoutX="187.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
<Button fx:id="btn3" layoutX="255.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
<Button fx:id="btn6" layoutX="505.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
<Button fx:id="btn4" layoutX="351.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
<Button fx:id="btn5" layoutX="436.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
</ArrayList>
</fx:define>
I get error in each button and I even can't open fxml in sceneBuilder. What is wrong with thisenter image description here
Full code of fxml below
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import java.util.ArrayList?>
<AnchorPane fx:controller="sample.Controller" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<fx:define>
<ArrayList fx:id="buttons">
<Button fx:id="btn1" layoutX="93.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
<Button fx:id="btn2" layoutX="187.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
<Button fx:id="btn3" layoutX="255.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
<Button fx:id="btn6" layoutX="505.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
<Button fx:id="btn4" layoutX="351.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
<Button fx:id="btn5" layoutX="436.0" layoutY="31.0" mnemonicParsing="false" text="Button" />
</ArrayList>
</fx:define>
</children>
</AnchorPane>
I want to store all buttons in one array in controller
I don't think it's possible to add children in a List, especially standard ArrayList. FX components use ObservableList to store children components.
I suggest you add your buttons to a group, like this:
<AnchorPane>
<Group fx:id="group">
<Button fx:id="btn1" layoutX="93.0" layoutY="31.0" mnemonicParsing="false" text="Button"/>
<Button fx:id="btn2" layoutX="187.0" layoutY="31.0" mnemonicParsing="false" text="Button"/>
<Button fx:id="btn3" layoutX="255.0" layoutY="31.0" mnemonicParsing="false" text="Button"/>
<Button fx:id="btn6" layoutX="505.0" layoutY="31.0" mnemonicParsing="false" text="Button"/>
<Button fx:id="btn4" layoutX="351.0" layoutY="31.0" mnemonicParsing="false" text="Button"/>
<Button fx:id="btn5" layoutX="436.0" layoutY="31.0" mnemonicParsing="false" text="Button"/>
</Group>
</AnchorPane>
Your buttons will be visible in your app and you can do operations on group children almost like it was a standard list.

Add stylesheet to openxml excel file

I'm trying to insert some styles in a excel file. Right now the data part works perfectly, but the style throws an error when I open the excel. It complains that the stylesheet file has an error in line 19 of the xml. I don't know what is wrong with that line. It is where the font collection node start.
Any ideas why...
This is the xml for the style
<?xml version="1.0" encoding="utf-8"?>
<x:styleSheet xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main" mc:Ignorable="x14ac">
<x:borders count="1">
<x:border>
<x:left style="thin">
<x:color indexed="64" rgb="000000" />
</x:left>
<x:right style="thin">
<x:color indexed="64" rgb="000000" />
</x:right>
<x:top style="thin">
<x:color indexed="64" rgb="000000" />
</x:top>
<x:bottom style="thin">
<x:color indexed="64" rgb="000000" />
</x:bottom>
</x:border>
</x:borders>
<x:fonts count="1">
<x:font>
<x:b />
<x:sz val="12" />
<x:color rgb="000000" />
<x:name val="Arial" />
</x:font>
</x:fonts>
<x:cellXfs>
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf fontId="0" borderId="0" applyFont="1" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
<x:xf borderId="0" applyBorder="1" />
</x:cellXfs>
</x:styleSheet>
UPDATE
After some testing, googling, head banging.... I came up with the following stylesheet xml
<?xml version="1.0" encoding="utf-8"?>
<x:styleSheet xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" mc:Ignorable="x14ac x16r2 xr">
<x:fonts count="2" x14ac:knownFonts="1">
<x:font />
<x:font>
<x:b />
<x:sz val="12" />
<x:color rgb="FF000000" />
<x:name val="Arial" />
<x:family val="2" />
<x:scheme val="minor" />
</x:font>
</x:fonts>
<x:borders count="2">
<x:border />
<x:border>
<x:left style="thin">
<x:color rgb="FF000000" />
</x:left>
<x:right style="thin">
<x:color rgb="FF000000" />
</x:right>
<x:top style="thin">
<x:color rgb="FF000000" />
</x:top>
<x:bottom style="thin">
<x:color rgb="FF000000" />
</x:bottom>
</x:border>
</x:borders>
<x:cellXfs count="3">
<x:xf />
<x:xf fontId="1" borderId="1" applyFont="1" applyBorder="1" />
<x:xf borderId="1" applyBorder="1" />
</x:cellXfs>
</x:styleSheet>
Still excel complains that the file is corrupt after recovering the file it displays the styles applied to each cell gives the error "Repaired Records: Format from /xl/styles.xml part (Styles)" .
LibreOffice opens the file correctly, OPEN XML SDK 2.0 Productivity Tool validates the file as correct...Why excel complains.....
UPDATE
After playing around with the code I solved the problem.
This two questions also helped
Stylesheet 1
Stylesheet 2
It seems that there is an order to create the nodes, specially the cellStyleXfs and cellXfs, the cellStyleXfs as to come before the cellXfs
The working XML
<?xml version="1.0" encoding="utf-8"?>
<x:styleSheet xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" mc:Ignorable="x14ac x16r2 xr">
<x:fonts count="3" x14ac:knownFonts="1">
<x:font />
<x:font>
<x:b />
<x:sz val="12" />
<x:color rgb="FF000000" />
<x:name val="Arial" />
<x:family val="2" />
<x:scheme val="minor" />
</x:font>
<x:font>
<x:b />
<x:sz val="12" />
<x:color rgb="FFFF0000" />
<x:name val="Arial" />
<x:family val="2" />
<x:scheme val="minor" />
</x:font>
</x:fonts>
<x:fills count="1">
<x:fill />
</x:fills>
<x:borders count="2">
<x:border />
<x:border>
<x:left style="thin">
<x:color rgb="FF000000" />
</x:left>
<x:right style="thin">
<x:color rgb="FF000000" />
</x:right>
<x:top style="thin">
<x:color rgb="FF000000" />
</x:top>
<x:bottom style="thin">
<x:color rgb="FF000000" />
</x:bottom>
<x:diagonal />
</x:border>
</x:borders>
<x:cellStyleXfs count="1">
<x:xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />
</x:cellStyleXfs>
<x:cellXfs count="4">
<x:xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />
<x:xf numFmtId="0" fontId="1" fillId="0" borderId="1" xfId="0" applyNumberFormat="1" applyFont="1" applyFill="1" applyBorder="1" />
<x:xf numFmtId="0" fontId="2" fillId="0" borderId="1" xfId="0" applyNumberFormat="1" applyFont="1" applyFill="1" applyBorder="1" />
<x:xf numFmtId="0" fontId="0" fillId="0" borderId="1" xfId="0" applyNumberFormat="1" applyFont="1" applyFill="1" applyBorder="1" />
</x:cellXfs>
</x:styleSheet>
Excel is limited to a palette of 56 colors. The indexes are stored rather than the actual RGB value as you have provided. I don't know how you are generating the xmls, but your font node should look something like this:
<x:fonts count="1">
<x:font>
<x:b />
<x:sz val="12" />
<x:color theme="1" />
<x:name val="Arial" />
</x:font>
</x:fonts>
If you use C# or VBA then you can set Colors to your liking by accessing Workbook.Colors Property
EDIT
Like for fonts, borders need to store indexes rather than the actual RGB value as you have provided. Your border node should be something like:
<x:left style="thin">
<x:color indexed="64" />
</x:left>
also note, borders need to defined in the correct order: left, right, top, bottom, diagonal. Seems correct in your xml but nevertheless thought of mentioning it here.
This is a good example

ListView not showing all items

I have a ListView and a button and i want to align button at the bottom of ListView, i had successfully align button at the bottom but the problem is that listview is showing only 1 row. But it has 6 rows. Please anybody help me.Thanks in advance
Here is My layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/relativeNavBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/nav_bar" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Edit Item"
android:textColor="#android:color/white"
android:textSize="20dp"
android:textStyle="bold" />
<Button
android:id="#+id/btnBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"
android:layout_marginRight="5dp"
android:text="Back"
android:textColor="#android:color/black"
android:textSize="14dp"
android:textStyle="bold" />
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="ItemName"
android:textColor="#android:color/black"
android:textSize="18dp"
android:textStyle="bold" />
<EditText
android:id="#+id/EditItem_edtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:ems="10"
android:imeOptions="actionNext"
android:inputType="text"
android:textColor="#android:color/black"
android:textSize="16dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="Recurring"
android:textColor="#android:color/black"
android:textSize="18dp"
android:textStyle="bold" />
<ToggleButton
android:id="#+id/EditItem_toggleRecurring"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_marginLeft="21dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<Button
android:id="#+id/EditItem_btnNotes"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="Notes"
android:textColor="#android:color/black"
android:textSize="18dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="Priority"
android:textColor="#android:color/black"
android:textSize="18dp"
android:textStyle="bold" />
<RadioGroup
android:id="#+id/EditItem_radioGrp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/EditItem_radioLow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:paddingLeft="10dp" />
<RadioButton
android:id="#+id/EditItem_radioMedm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp" />
<RadioButton
android:id="#+id/EditItem_radioHigh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<Button
android:id="#+id/EditItem_btnAddCategory"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="Add this item into category"
android:textColor="#android:color/black"
android:textSize="18dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:padding="5dp" >
<Button
android:id="#+id/EditItem_btnAssignment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="Assignment"
android:textColor="#android:color/black"
android:textSize="18dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical"
android:padding="5dp" >
<ListView
android:id="#+id/EditItem_lvStores"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="#android:color/black"
android:dividerHeight="1dp"
android:footerDividersEnabled="true"
android:scrollingCache="false" >
</ListView>
<Button
android:id="#+id/EditItem_btnSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Save"
android:textColor="#android:color/black"
android:textSize="18dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout
You shouldn't put a ListView inside a ScrollView because the ListView class implements its own scrolling and it just doesn't receive gestures because they all are handled by the parent ScrollView. Also you can find some solutions here