自学HarmonyOS应用开发(75)- 显示拍摄结果

照片拍摄完成接下来的动作就是确认拍照结果。我们的实现方法是对前面文章中用到的文件浏览器功能进行扩展,从而实现一个简单的照片浏览器功能。

增加照片浏览器画面

照片浏览器画面使用下面的布局。

<?xml version="1.0" encoding="utf-8"?><xwg.dynamiclayout.DynamicLayout    xmlns:ohos="http://schemas.huawei.com/res/ohos"    ohos:height="match_parent"    ohos:width="match_parent"    ohos:background_element="$graphic:main_ability_title_background"    ohos:orientation="vertical">    <xwg.fileitems.FileListContainer        ohos:id="$+id:list_container"        ohos:height="0"        ohos:weight="300"        ohos:width="match_parent"        ohos:layout_alignment="left"/>    <xwg.dynamiclayout.LayoutSeparator        ohos:id="$+id:seperator"        ohos:height="20vp"        ohos:width="match_parent"        ohos:background_element="#7F7F7F"/>    <DirectionalLayout        ohos:id="$+id:detail_view_container"        ohos:width="match_parent"        ohos:height="0"        ohos:weight = "300"/></xwg.dynamiclayout.DynamicLayout>

代码中用到的FileListContainer,LayoutSeparator都在之前的文章中有过说明,这里就不再赘述了。

和这个布局文件配套的页面文件如下:​​​​​​​

public class BrowserSlice  extends AbilitySlice {
  
      static final HiLogLabel LABEL = new HiLogLabel(HiLog.LOG_APP, 0x00101, "MainAbilitySlice");    @Override    public void onStart(Intent intent) {
  
          setUIContent(ResourceTable.Layout_browser_ability);        String path = intent.getStringParam("Path");        initListContainer(path);    }
    @Override    public void onActive() {
  
          super.onActive();
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值