深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上鸿蒙开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
ohos:bottom_margin=“40vp”
ohos:bottom_padding=“8vp”
ohos:center_in_parent=“true”
ohos:left_padding=“70vp”
ohos:right_padding=“70vp”
ohos:text=“Next”
ohos:text_color=“#ffffff”
ohos:text_size=“19fp”
ohos:top_padding=“8vp”
/>
background_button
<?xml version="1.0" encoding="utf-8"?><shape
xmlns:ohos=“http://schemas.huawei.com/res/ohos”
ohos:shape=“rectangle”>
<corners
ohos:radius=“100”/>
<solid
ohos:color=“#007DFF”/>
MainAbilitySlice.java
public class MainAbilitySlice extends AbilitySlice {
@Override
public void onStart(Intent intent) {
super.onStart(intent);
super.setUIContent(ResourceTable.Layout_ability_main);
Button button= (Button) findComponentById(ResourceTable.Id_button);
if (button!=null){
//为按钮设置点击回调
button.setClickedListener(new Component.ClickedListener() {
@Override
public void onClick(Component component) {
Intent secondIntent=new Intent();
// 指定待启动FA的bundleName和abilityName
Operation operation = new Intent.OperationBuilder()
.withDeviceId(“”)
.withBundleName(“com.example.harmonyosdemo”)
.withAbilityName(“com.example.harmonyosdemo.SecondAbility”)
.build();
secondIntent.setOperation(operation);
// 通过AbilitySlice的startAbility接口实现启动另一个页面
startAbility(secondIntent);
}
});
}
}
@Override
public void onActive() {
super.onActive();
}
@Override
public void onForeground(Intent intent) {
super.onForeground(intent);
}
}
MainAbility
public class MainAbility extends Ability {
@Override
public void onStart(Intent intent) {
super.onStart(intent);
super.setMainRoute(MainAbilitySlice.class.getName());
}
}
4.1 页面组成
-
entry > src > main > resources > base > layout——>ability_second.xml
-
entry > src > main > java > com.example.harmonyosdemo> slice>SecondAbilitySlice.java
-
entry > src > main > java > com.example.harmonyosdemo>SecondAbility.java
4.2 页面内容
ability_second.xml
<?xml version="1.0" encoding="utf-8"?><DependentLayout
xmlns:ohos=“http://schemas.huawei.com/res/ohos”
ohos:height=“match_parent”
ohos:width=“match_parent”
ohos:background_element=“#ffffff”>
<Text
ohos:id=“$+id:text”
ohos:height=“match_content”
ohos:width=“match_content”
ohos:center_in_parent=“true”
ohos:text="Second Page "
ohos:text_color=“#000000”
ohos:text_size=“32fp”/>
<Button
ohos:id=“$+id:buttonReturn”
ohos:height=“match_content”
ohos:width=“match_content”
ohos:align_parent_bottom=“true”
ohos:background_element=“$graphic:background_button”
ohos:bottom_margin=“40vp”
ohos:bottom_padding=“8vp”
ohos:center_in_parent=“true”
ohos:left_padding=“70vp”
ohos:right_padding=“70vp”
ohos:text=“Return”
ohos:text_color=“#ffffff”
ohos:text_size=“19fp”
ohos:top_padding=“8vp”
/>
SecondAbilitySlice
public class SecondAbilitySlice extends AbilitySlice {
@Override
public void onStart(Intent intent) {
super.onStart(intent);
// 声明布局
super.setUIContent(ResourceTable.Layout_ability_second);
((Button)findComponentById(ResourceTable.Id_buttonReturn)).setClickedListener(new Component.ClickedListener() {
@Override
public void onClick(Component component) {
onBackPressed();
}
});
// DependentLayout myLayout = new DependentLayout(this);
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
[外链图片转存中…(img-UdCPsyuB-1715717188100)]
[外链图片转存中…(img-X7OYidV3-1715717188101)]
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!