1.首先进入网页 https://hmxt.org/deveco-studio 选择开大工具下载 再点击官方下载 下载完成后双击安装 注意不要安装在c盘中,中间一路accept。
2.新建一个tv应用 如图 选择 设置好项目路径,包名,项目名。
3.进入开发页面如下,个人感觉上和android开发是很像的。
4.在idea中打开项目目录如图,依次点开entry src main java resources base 右键base 依次选择 new directory 点击 名为layout 回车 ,然后在项目目录中的layout 右键 依次new file 输入要创建的布局文件名称 以.xml 结尾 例如 main_layout.xml
5.将下列代码复制到新建好的 xml文件中
xmlns:ohos="http://schemas.huawei.com/res/ohos"
ohos:width="match_parent"
ohos:height="match_parent"
ohos:background_element="#000000">
ohos:id="$+id:text"
ohos:width="match_content"
ohos:height="match_content"
ohos:center_in_parent="true"
ohos:text="Hello World"
ohos:text_color="white"
ohos:text_size="32