鸿蒙应用开发,鸿蒙应用开发-DevEco Studio 模板体验(五)

详细步骤可查看下面三个视频:

显示效果:

1460000040011391

可以左右滑动

1460000040011392

布局中的代码<?xml version="1.0" encoding="utf-8"?>

xmlns:ohos="http://schemas.huawei.com/res/ohos"

ohos:height="match_content"

ohos:width="match_parent"

ohos:background_element="$graphic:main_ability_title_background"

ohos:orientation="vertical">

ohos:id="$id:app_bar"

ohos:height="match_content"

ohos:width="match_parent"

ohos:layout="$layout:app_bar_layout"/>

ohos:id="$+id:page_view"

ohos:height="match_content"

ohos:width="match_parent"/>

ohos:id="$+id:page_indicator"

ohos:height="$float:page_indicator_height"

ohos:width="match_parent"

ohos:bottom_margin="$float:margin_page_slider_indicator"

ohos:layout_alignment="center"

ohos:top_margin="$float:margin_page_slider_indicator"/>

ohos:id="$+id:list_view"

ohos:height="match_content"

ohos:width="match_parent"

ohos:background_element="$graphic:item_background"

ohos:top_margin="$float:breadth_common"/>

显示效果:

1460000040011393

点击其中任何的一条信息都可以进入下一个页面

1460000040011394<?xml version="1.0" encoding="utf-8"?>

xmlns:ohos="http://schemas.huawei.com/res/ohos"

ohos:id="$+id:parent_layout"

ohos:height="match_parent"

ohos:width="match_parent">

ohos:height="match_parent"

ohos:width="match_parent">

ohos:height="match_content"

ohos:width="match_parent"

ohos:bottom_padding="70vp"

ohos:orientation="vertical">

ohos:height="match_content"

ohos:width="match_parent"

ohos:alignment="vertical_center"

ohos:orientation="horizontal">

ohos:id="$+id:image"

ohos:height="50vp"

ohos:width="50vp"

ohos:image_src="$media:huawei"

ohos:layout_alignment="left"

ohos:left_margin="10vp"

ohos:scale_mode="stretch"/>

ohos:id="$+id:title_icon"

ohos:height="match_content"

ohos:width="match_content"

ohos:text="$string:title"

ohos:text_size="20fp"

ohos:weight="1"/>

ohos:height="match_content"

ohos:width="match_content"

ohos:right_margin="10vp"

ohos:text="$string:read"

ohos:text_size="10fp"/>

ohos:height="match_content"

ohos:width="match_content"

ohos:right_margin="20vp"

ohos:text="$string:like"

ohos:text_size="10fp"/>

ohos:id="$+id:title_text"

ohos:height="match_content"

ohos:width="match_parent"

ohos:left_margin="20vp"

ohos:max_text_lines="4"

ohos:multiple_lines="true"

ohos:right_margin="20vp"

ohos:text="$string:original_title"

ohos:text_color="#000000"

ohos:text_size="18fp"

ohos:top_margin="10vp"/>

ohos:id="$+id:title_content"

ohos:height="match_content"

ohos:width="match_parent"

ohos:left_margin="20vp"

ohos:multiple_lines="true"

ohos:right_margin="20vp"

ohos:text_alignment="center_horizontal"

ohos:text_color="#708090"

ohos:text_size="16fp"

ohos:top_margin="5vp"/>

ohos:height="match_content"

ohos:width="match_parent"

ohos:orientation="horizontal">

ohos:id="$+id:image_content1"

ohos:height="100vp"

ohos:width="0vp"

ohos:image_src="$media:content"

ohos:layout_alignment="center"

ohos:left_margin="20vp"

ohos:right_margin="2vp"

ohos:top_margin="10vp"

ohos:weight="1"/>

ohos:id="$+id:image_content2"

ohos:height="100vp"

ohos:width="0vp"

ohos:image_src="$media:news_big_5g"

ohos:layout_alignment="center"

ohos:left_margin="10vp"

ohos:right_margin="2vp"

ohos:top_margin="10vp"

ohos:weight="1"/>

ohos:id="$+id:image_content3"

ohos:height="100vp"

ohos:width="0vp"

ohos:image_src="$media:content_news"

ohos:layout_alignment="center"

ohos:left_margin="2vp"

ohos:right_margin="20vp"

ohos:top_margin="10vp"

ohos:weight="1"/>

ohos:height="0.5vp"

ohos:width="match_parent"

ohos:above="$+id:bottom_layout"

ohos:background_element="#EAEAEC"

/>

ohos:id="$+id:bottom_layout"

ohos:height="50vp"

ohos:width="match_parent"

ohos:align_parent_bottom="true"

ohos:alignment="vertical_center"

ohos:background_element="#ffffff"

ohos:left_padding="20vp"

ohos:orientation="horizontal"

ohos:right_padding="20vp"

>

ohos:id="$+id:text_file"

ohos:height="30vp"

ohos:width="160vp"

ohos:background_element="$graphic:corner_bg_comment"

ohos:hint="$string:comment"

ohos:left_padding="5vp"

ohos:right_padding="10vp"

ohos:text_alignment="vertical_center"

ohos:text_size="15vp"/>

ohos:id="$+id:button1"

ohos:height="20vp"

ohos:width="20vp"

ohos:image_src="$media:message_icon"

ohos:left_margin="20vp"/>

ohos:id="$+id:button2"

ohos:height="20vp"

ohos:width="20vp"

ohos:image_src="$media:collect_icon"

ohos:left_margin="20vp"/>

ohos:id="$+id:button3"

ohos:height="20vp"

ohos:width="20vp"

ohos:image_src="$media:like_icon"

ohos:left_margin="20vp"/>

ohos:id="$+id:button4"

ohos:height="20vp"

ohos:width="20vp"

ohos:image_src="$media:share_icon"

ohos:left_margin="20vp"/>

显示效果:

1460000040011395

放置一些内容 可以上下滑动

布局中的代码<?xml version="1.0" encoding="utf-8"?>

xmlns:ohos="http://schemas.huawei.com/res/ohos"

ohos:height="$float:list_item_height"

ohos:width="match_parent"

ohos:bottom_padding="$float:list_item_bottom_padding"

ohos:top_padding="$float:list_item_top_padding"

>

ohos:id="$+id:head_image_layout"

ohos:height="match_content"

ohos:width="match_content"

ohos:right_margin="$float:list_item_profile_picture_right_margin"

ohos:vertical_center="true"

>

ohos:id="$+id:list_left_image"

ohos:height="match_content"

ohos:width="match_content"

ohos:image_src="$media:ori_star"

/>

ohos:id="$+id:left_layout"

ohos:height="match_content"

ohos:width="match_content"

ohos:bottom_margin="$float:list_item_double_line_bottom_margin"

ohos:end_of="$id:head_image_layout"

ohos:orientation="vertical"

ohos:vertical_center="true"

>

ohos:id="$+id:list_main_text"

ohos:height="match_content"

ohos:width="match_content"

ohos:alpha="0.9"

ohos:multiple_lines="true"

ohos:text="$string:Double_line_list_item"

ohos:text_alignment="vertical_center|left"

ohos:text_size="$float:list_item_main_text_size"

/>

ohos:id="$+id:list_aux_text"

ohos:height="match_content"

ohos:width="match_content"

ohos:alpha="0.6"

ohos:multiple_lines="true"

ohos:text="$string:Auxiliary_text"

ohos:text_alignment="vertical_center|left"

ohos:text_size="$float:list_item_aux_text_size"

/>

ohos:id="$+id:right_layout"

ohos:height="match_content"

ohos:width="match_parent"

ohos:alignment="right"

ohos:end_of="$id:left_layout"

ohos:orientation="horizontal"

ohos:vertical_center="true"

>

ohos:id="$+id:list_right_text"

ohos:height="match_content"

ohos:width="match_content"

ohos:alpha="0.6"

ohos:multiple_lines="true"

ohos:right_margin="4vp"

ohos:text="$string:Right_text"

ohos:text_size="$float:list_item_right_text_size"

/>

ohos:id="$+id:list_right_image"

ohos:height="match_content"

ohos:width="match_content"

ohos:image_src="$media:right_arrow"

ohos:layout_alignment="vertical_center"

/>

ohos:height="$float:list_item_divider_height"

ohos:width="match_parent"

ohos:alpha="0.3"

ohos:background_element="$graphic:item_divider"

ohos:below="$id:left_layout"

ohos:end_of="$id:head_image_layout"

/>

完整代码地址:

深度学习是机器学习的一个子领域,它基于人工神经网络的研究,特别是利用多层次的神经网络来进行学习和模式识别。深度学习模型能够学习数据的高层次特征,这些特征对于图像和语音识别、自然语言处理、医学图像分析等应用至关重要。以下是深度学习的一些关键概念和组成部分: 1. **神经网络(Neural Networks)**:深度学习的基础是人工神经网络,它是由多个层组成的网络结构,包括输入层、隐藏层和输出层。每个层由多个神经元组成,神经元之间通过权重连接。 2. **前馈神经网络(Feedforward Neural Networks)**:这是最常见的神经网络类型,信息从输入层流向隐藏层,最终到达输出层。 3. **卷积神经网络(Convolutional Neural Networks, CNNs)**:这种网络特别适合处理具有网格结构的数据,如图像。它们使用卷积层来提取图像的特征。 4. **循环神经网络(Recurrent Neural Networks, RNNs)**:这种网络能够处理序列数据,如时间序列或自然语言,因为它们具有记忆功能,能够捕捉数据中的时间依赖性。 5. **长短期记忆网络(Long Short-Term Memory, LSTM)**:LSTM 是一种特殊的 RNN,它能够学习长期依赖关系,非常适合复杂的序列预测任务。 6. **生成对抗网络(Generative Adversarial Networks, GANs)**:由两个网络组成,一个生成器和一个判别器,它们相互竞争,生成器生成数据,判别器评估数据的真实性。 7. **深度学习框架**:如 TensorFlow、Keras、PyTorch 等,这些框架提供了构建、训练和部署深度学习模型的工具和库。 8. **激活函数(Activation Functions)**:如 ReLU、Sigmoid、Tanh 等,它们在神经网络中用于添加非线性,使得网络能够学习复杂的函数。 9. **损失函数(Loss Functions)**:用于评估模型的预测与真实值之间的差异,常见的损失函数包括均方误差(MSE)、交叉熵(Cross-Entropy)等。 10. **优化算法(Optimization Algorithms)**:如梯度下降(Gradient Descent)、随机梯度下降(SGD)、Adam 等,用于更新网络权重,以最小化损失函数。 11. **正则化(Regularization)**:技术如 Dropout、L1/L2 正则化等,用于防止模型过拟合。 12. **迁移学习(Transfer Learning)**:利用在一个任务上训练好的模型来提高另一个相关任务的性能。 深度学习在许多领域都取得了显著的成就,但它也面临着一些挑战,如对大量数据的依赖、模型的解释性差、计算资源消耗大等。研究人员正在不断探索新的方法来解决这些问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值