同时创建多个视图的主题
有时您希望在多个视图中将相同的属性应用于相同的元素。name属性实际上是一个列表(由任何字符(即空白和逗号)分隔)。因此,例如,要轻松地将同一标题应用于基本视图、网格视图和系统视图,请执行以下操作:
<theme>
<formatVersion>3</formatVersion>
<view name="basic, grid, system">
<image name="logo">
<path>./snes_art/snes_header.png</path>
</image>
</view>
<view name="detailed">
<image name="logo">
<path>./snes_art/snes_header_detailed.png</path>
</image>
</view>
</theme>
这相当于
<theme>
<formatVersion>3</formatVersion>
<view name="basic">
<image name="logo">
<path>./snes_art/snes_header.png</path>
</image>
</view>
<view name="detailed">
<image name="logo">
<path>./snes_art/snes_header_detailed.png</path>
</image>
</view>
<view name="grid">
<image name="logo">
<path>./snes_art/snes_header.png</path>
</image>
</view>
<view name="system">
<image name="logo">
<path>./snes_art/snes_header.png</path>
</image>
</view>
... and any other view that might try to look up "logo" ...
</theme>
同时创建多个元素的主题
可以同时为同一类型的多个元素设置主题。name属性实际上是一个列表(由任何字符(即空白和逗号)分隔),就像视图一样,只要元素具有相同的类型。如果要对所有元数据标签应用相同的颜色,则此选项非常有用:
<theme>
<formatVersion>3</formatVersion>
<view name="detailed">
<!-- Weird spaces/newline on purpose! -->
<text name="md_lbl_rating, md_lbl_releasedate, md_lbl_developer, md_lbl_publisher,
md_lbl_genre, md_lbl_players, md_lbl_lastplayed, md_lbl_playcount">
<color>48474D</color>
</text>
</view>
</theme>
这相当于
<theme>
<formatVersion>3</formatVersion>
<view name="detailed">
<text name="md_lbl_rating">
<color>48474D</color>
</text>
<text name="md_lbl_releasedate">
<color>48474D</color>
</text>
<text name="md_lbl_developer">
<color>48474D</color>
</text>
<text name="md_lbl_publisher">
<color>48474D</color>
</text>
<text name="md_lbl_genre">
<color>48474D</color>
</text>
<text name="md_lbl_players">
<color>48474D</color>
</text>
<text name="md_lbl_lastplayed">
<color>48474D</color>
</text>
<text name="md_lbl_playcount">
<color>48474D</color>
</text>
</view>
</theme>
请记住,只有当元素具有相同的类型时,这才有效!
有时您希望在多个视图中将相同的属性应用于相同的元素。name属性实际上是一个列表(由任何字符(即空白和逗号)分隔)。因此,例如,要轻松地将同一标题应用于基本视图、网格视图和系统视图,请执行以下操作:
<theme>
<formatVersion>3</formatVersion>
<view name="basic, grid, system">
<image name="logo">
<path>./snes_art/snes_header.png</path>
</image>
</view>
<view name="detailed">
<image name="logo">
<path>./snes_art/snes_header_detailed.png</path>
</image>
</view>
</theme>
这相当于
<theme>
<formatVersion>3</formatVersion>
<view name="basic">
<image name="logo">
<path>./snes_art/snes_header.png</path>
</image>
</view>
<view name="detailed">
<image name="logo">
<path>./snes_art/snes_header_detailed.png</path>
</image>
</view>
<view name="grid">
<image name="logo">
<path>./snes_art/snes_header.png</path>
</image>
</view>
<view name="system">
<image name="logo">
<path>./snes_art/snes_header.png</path>
</image>
</view>
... and any other view that might try to look up "logo" ...
</theme>
同时创建多个元素的主题
可以同时为同一类型的多个元素设置主题。name属性实际上是一个列表(由任何字符(即空白和逗号)分隔),就像视图一样,只要元素具有相同的类型。如果要对所有元数据标签应用相同的颜色,则此选项非常有用:
<theme>
<formatVersion>3</formatVersion>
<view name="detailed">
<!-- Weird spaces/newline on purpose! -->
<text name="md_lbl_rating, md_lbl_releasedate, md_lbl_developer, md_lbl_publisher,
md_lbl_genre, md_lbl_players, md_lbl_lastplayed, md_lbl_playcount">
<color>48474D</color>
</text>
</view>
</theme>
这相当于
<theme>
<formatVersion>3</formatVersion>
<view name="detailed">
<text name="md_lbl_rating">
<color>48474D</color>
</text>
<text name="md_lbl_releasedate">
<color>48474D</color>
</text>
<text name="md_lbl_developer">
<color>48474D</color>
</text>
<text name="md_lbl_publisher">
<color>48474D</color>
</text>
<text name="md_lbl_genre">
<color>48474D</color>
</text>
<text name="md_lbl_players">
<color>48474D</color>
</text>
<text name="md_lbl_lastplayed">
<color>48474D</color>
</text>
<text name="md_lbl_playcount">
<color>48474D</color>
</text>
</view>
</theme>
请记住,只有当元素具有相同的类型时,这才有效!