obsidian/笔记文件/2.笔记/ios试验_第一章.md
2025-03-26 00:02:56 +08:00

139 lines
2.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

![[Pasted image 20240929133515.png]]
![[Pasted image 20240929134518.png]]
![[Pasted image 20240929134534.png]]
![[Pasted image 20240929134611.png]]
![[Pasted image 20240929134637.png]]
![[Pasted image 20240929174119.png]]
![[Pasted image 20240929174418.png]]
![[Pasted image 20240929174435.png]]
可以拖拽使用ui组件
![[Pasted image 20240929174539.png]]
![[Pasted image 20240929175536.png]]
![[Pasted image 20240929181737.png]]
效果
![[Pasted image 20240929181759.png]]
拖曳后的配置
![[Pasted image 20240929181847.png]]
需要注意的是上述拖曳的操作是在oc的.h头文件里面进行的声明操作
![[Pasted image 20240929182019.png]]
在.m可执行文件中也随之生成了按钮点击相关接口
![[Pasted image 20240929182116.png]]
写一个helloworld的窗体逻辑
![[Pasted image 20240929182218.png]]
运行后的,点击效果
![[Pasted image 20240929182259.png]]
![[Pasted image 20240929182343.png]]
xcode工程文件结构
![[Pasted image 20240929182408.png]]
![[Pasted image 20240929182759.png]]
![[Pasted image 20240929182818.png]]
![[Pasted image 20240930094450.png]]
视图的创建,有不同的方法
![[Pasted image 20240930095110.png]]
手动创建的方式
![[Pasted image 20240930095350.png]]
![[Pasted image 20240930100134.png]]
颜色设置相关
![[Pasted image 20240930101228.png]]
测试效果
![[Pasted image 20240930101252.png]]
第二种方式,通过代码创建
![[Pasted image 20240930101311.png]]
在.m可执行文件写view界面相关就可以正常创建了左上角运行效果正常
![[Pasted image 20240930101348.png]]
![[Pasted image 20240930101550.png]]
![[Pasted image 20240930101615.png]]
![[Pasted image 20240930101630.png]]
![[Pasted image 20240930101713.png]]
![[Pasted image 20240930101733.png]]
![[Pasted image 20240930101753.png]]
上述介绍了,创建按钮的相关逻辑;
基于按钮的相关逻辑,创建一个警告视图的弹窗
![[Pasted image 20240930101844.png]]
run运行点击按钮警告弹窗显示正常
![[Pasted image 20240930103246.png]]
多项警告
![[Pasted image 20240930103337.png]]
写逻辑,等待编译完成
![[Pasted image 20240930103415.png]]
运行,多选项点击,正常
![[Pasted image 20240930103446.png]]
创建一个UILabel控件再在.h头文件中声明变量
然后按住Control键同时拖曳过去就可以完成绑定
![[Pasted image 20240930103716.png]]
然后删掉Label里面的文本内容
![[Pasted image 20240930103932.png]]
在.m可执行文件中也写好按钮点击和警告框和label的文本显示逻辑
![[Pasted image 20240930103903.png]]
运行,选中某个按钮
![[Pasted image 20240930104046.png]]
label文本显示正常
![[Pasted image 20240930104106.png]]