使用布局(layout)资源

来源:互联网 发布:python pil和opencv 编辑:程序博客网 时间:2024/06/02 05:30
使用布局(layout)资源

layout资源放置在res/layout目录下,
xml访问方式:
@[<package>:]layout/file_name
例如
@layout/liner.xml
java访问方式:
[<package>.].R.layout.<file_name>
例如:        
setContentView(R.layout.activity_main);