Sectie
Contents
[
Hide
]
Voorbeelden voor het beheren van presentatiesecties—toevoegen, benaderen, verwijderen en hernoemen via code met Aspose.Slides for Android via Java.
Sectie toevoegen
Maak een sectie aan die begint op een specifieke dia.
static void addSection() {
Presentation presentation = new Presentation();
try {
ISlide slide = presentation.getSlides().get_Item(0);
// Specificeer de dia die het begin van de sectie aangeeft.
presentation.getSections().addSection("New Section", slide);
} finally {
presentation.dispose();
}
}
Sectie benaderen
Lees sectie-informatie uit een presentatie.
static void accessSection() {
Presentation presentation = new Presentation();
try {
ISlide slide = presentation.getSlides().get_Item(0);
presentation.getSections().addSection("My Section", slide);
// Benader een sectie op index.
ISection section = presentation.getSections().get_Item(0);
String sectionName = section.getName();
} finally {
presentation.dispose();
}
}
Sectie verwijderen
Verwijder een eerder toegevoegde sectie.
static void removeSection() {
Presentation presentation = new Presentation();
try {
ISlide slide = presentation.getSlides().get_Item(0);
ISection section = presentation.getSections().addSection("Temporary Section", slide);
// Verwijder de eerste sectie.
presentation.getSections().removeSection(section);
} finally {
presentation.dispose();
}
}
Sectie hernoemen
Verander de naam van een bestaande sectie.
static void renameSection() {
Presentation presentation = new Presentation();
try {
ISlide slide = presentation.getSlides().get_Item(0);
presentation.getSections().addSection("Old Name", slide);
ISection section = presentation.getSections().get_Item(0);
section.setName("New Name");
} finally {
presentation.dispose();
}
}