首页 > 代码库 > 3.App Resources-Resource Types/Layout Resource
3.App Resources-Resource Types/Layout Resource
1. Layout Resources
A layout resource defines the architecture for the UI in an Activity or a component of a UI.
2. Syntax
<?xml version="1.0" encoding="utf-8"?><ViewGroup //A container for other View elements xmlns:android="http://schemas.android.com/apk/res/android" android:id="@[+][package:]id/resource_name" android:layout_height=["dimension" | "fill_parent" | "wrap_content"] android:layout_width=["dimension" | "fill_parent" | "wrap_content"] [ViewGroup-specific attributes] >
<View //An individual UI component, generally referred to as a "widget". android:id="@[+][package:]id/resource_name" android:layout_height=["dimension" | "fill_parent" | "wrap_content"] android:layout_width=["dimension" | "fill_parent" | "wrap_content"] [View-specific attributes] > <requestFocus/>//Any element representing a View object can include this empty element, which gives its parent initial focus on the screen. You can have only one of these elements per file. </View>
<ViewGroup > <View /> </ViewGroup>
<include layout="@layout/layout_resource"/>
</ViewGroup>
3.App Resources-Resource Types/Layout Resource
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。