BaiduMap_IOSSDK_v7.2.0_Docs 7.2.0

BMKBaseUIView.h
浏览该文件的文档.
1 //
2 // BMKBaseUIView.h
3 // MapComponent
4 //
5 // Created by zhaoxiangru on 2024/3/12.
6 // Copyright © 2024 Baidu. All rights reserved.
7 //
8
9 #import <Foundation/Foundation.h>
10 #import <BaiduMapAPI_Base/BMKTypes.h>
11
12 NS_ASSUME_NONNULL_BEGIN
17 typedef enum : NSUInteger {
18 BMKVisibilityVisible = (0x1 << 0), // 可见
19 BMKVisibilityInvisible = (0x1 << 1), // 不可见，但占用空间区域 (暂不支持)
20 BMKVisibilityGone = (0x1 << 2), // 不可见，也不占用空间区域
21 } BMKVisibility;
22
26 typedef enum : NSUInteger {
27 BMKGravityLeft = (0x1 << 0),
28 BMKGravityTop = (0x1 << 1),
29 BMKGravityRight = (0x1 << 2),
30 BMKGravityBottom = (0x1 << 3),
31 BMKGravityCenterHorizontal = (0x1 << 4),
32 BMKGravityCenterVertical = (0x1 << 5),
33 BMKGravityCenter = (BMKGravityCenterHorizontal | BMKGravityCenterVertical),
34 BMKGravityBottomHCenter = (BMKGravityBottom | BMKGravityCenterHorizontal),
35 } BMKGravityType;
36
37 @interface BMKBaseUIView : NSObject
38 @property (nonatomic, assign) BMKVisibility visibility;
39 // UI宽高类型，默认为BMKOverlaySizeAdapt
40 @property (nonatomic, assign) BMKOverlaySizeType sizeType;
41 // 设置UI宽高，不设置按内容自适应（按图片或字体）；label也可以只设置width，代表按这个最大宽度适配多行文字，最多20行
42 // 宽高也会根据sizeType适配
43 @property (nonatomic, assign) int width;
44 @property (nonatomic, assign) int height;
45 // 一个基本条件：只有父容器的宽高大于内部控件宽高，才能体现出gravity 居左 局右 局上 局下，否则父容器默认是自适应的，是子控件把容器充满的，就体现不出gravity
46 // VerticalLayout默认是左上，只能对一个UI的底部对齐有效；只能对一个UI的垂直居中有效；对多个UI局右可以生效（即靠右对齐），多个UI局中垂直可以生效（即水平中线对齐）
47 // HorizontalLayout默认是左上，只能对一个UI的局右有效；只能对一个UI的水平局中有效；多个UI局下有效（即水平底部对齐），多个UI水平局中有效（即整体布局垂直中线对齐）
48 @property (nonatomic, assign) BMKGravityType gravity;
49 @property (nonatomic, assign) UIEdgeInsets padding;
50 @property (nonatomic, assign) UIEdgeInsets margin;
51 @property (nonatomic, assign) BOOL clickable;
53 // 背景图片，防止图片变形使用-setBackgroundImage：capInsets：设置背景图片
54 @property (nonatomic, strong) UIImage *background;
55 // 背景图片混合颜色，需要配合背景图片使用，单独设置无效；配合白色或部分透明背景图片使用，可以实现背景颜色自定义或圆角效果
56 @property (nonatomic, strong) UIColor *backgroundColor;
57
61 - (void)setBackgroundImage:(UIImage *)image capInsets:(UIEdgeInsets)capInsets;
62
64 - (void)setTarget:(nullable id)target action:(SEL)clickAction;
65 @end
66
67 NS_ASSUME_NONNULL_END
BMKBaseUIView::width
int width
Definition: BMKBaseUIView.h:43
BMKVisibilityVisible
@ BMKVisibilityVisible
Definition: BMKBaseUIView.h:18
BMKBaseUIView::background
UIImage * background
Definition: BMKBaseUIView.h:54
BMKBaseUIView
Definition: BMKBaseUIView.h:38
BMKOverlaySizeType
BMKOverlaySizeType
overlay大小的类型
Definition: BMKTypes.h:23
BMKBaseUIView::margin
UIEdgeInsets margin
Definition: BMKBaseUIView.h:50
BMKGravityCenterHorizontal
@ BMKGravityCenterHorizontal
Definition: BMKBaseUIView.h:31
BMKGravityCenter
@ BMKGravityCenter
Definition: BMKBaseUIView.h:33
BMKBaseUIView::padding
UIEdgeInsets padding
Definition: BMKBaseUIView.h:49
BMKGravityType
BMKGravityType
Definition: BMKBaseUIView.h:26
BMKVisibility
BMKVisibility
Definition: BMKBaseUIView.h:17
BMKBaseUIView::gravity
BMKGravityType gravity
Definition: BMKBaseUIView.h:48
BMKGravityRight
@ BMKGravityRight
Definition: BMKBaseUIView.h:29
BMKGravityBottomHCenter
@ BMKGravityBottomHCenter
Definition: BMKBaseUIView.h:34
BMKGravityBottom
@ BMKGravityBottom
Definition: BMKBaseUIView.h:30
BMKGravityTop
@ BMKGravityTop
Definition: BMKBaseUIView.h:28
BMKBaseUIView::visibility
BMKVisibility visibility
Definition: BMKBaseUIView.h:38
BMKGravityLeft
@ BMKGravityLeft
Definition: BMKBaseUIView.h:27
BMKVisibilityInvisible
@ BMKVisibilityInvisible
Definition: BMKBaseUIView.h:19
BMKGravityCenterVertical
@ BMKGravityCenterVertical
Definition: BMKBaseUIView.h:32
BMKBaseUIView::sizeType
BMKOverlaySizeType sizeType
Definition: BMKBaseUIView.h:40
BMKBaseUIView::clickable
BOOL clickable
Definition: BMKBaseUIView.h:51
BMKBaseUIView::height
int height
Definition: BMKBaseUIView.h:44
BMKVisibilityGone
@ BMKVisibilityGone
Definition: BMKBaseUIView.h:20
BMKBaseUIView::backgroundColor
UIColor * backgroundColor
Definition: BMKBaseUIView.h:56