BaiduMap_IOSSDK_v7.1.0_Docs 7.1.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
11 NS_ASSUME_NONNULL_BEGIN
16 typedef enum : NSUInteger {
17 BMKVisibilityVisible = (0x1 << 0), // 可见
18 BMKVisibilityInvisible = (0x1 << 1), // 不可见，但占用空间区域 (暂不支持)
19 BMKVisibilityGone = (0x1 << 2), // 不可见，也不占用空间区域
20 } BMKVisibility;
21
25 typedef enum : NSUInteger {
26 BMKGravityLeft = (0x1 << 0),
27 BMKGravityTop = (0x1 << 1),
28 BMKGravityRight = (0x1 << 2),
29 BMKGravityBottom = (0x1 << 3),
30 BMKGravityCenterHorizontal = (0x1 << 4),
31 BMKGravityCenterVertical = (0x1 << 5),
32 BMKGravityCenter = (BMKGravityCenterHorizontal | BMKGravityCenterVertical),
33 BMKGravityBottomHCenter = (BMKGravityBottom | BMKGravityCenterHorizontal),
34 } BMKGravityType;
35
36 @interface BMKBaseUIView : NSObject
37 @property (nonatomic, assign) BMKVisibility visibility;
38 // 设置UI宽高，不设置按内容自适应（按图片或字体）；label也可以只设置width，代表按这个最大宽度适配多行文字，最多20行
39 @property (nonatomic, assign) int width;
40 @property (nonatomic, assign) int height;
41 // 一个基本条件：只有父容器的宽高大于内部控件宽高，才能体现出gravity 居左 局右 局上 局下，否则父容器默认是自适应的，是子控件把容器充满的，就体现不出gravity
42 // VerticalLayout默认是左上，只能对一个UI的底部对齐有效；只能对一个UI的垂直居中有效；对多个UI局右可以生效（即靠右对齐），多个UI局中垂直可以生效（即水平中线对齐）
43 // HorizontalLayout默认是左上，只能对一个UI的局右有效；只能对一个UI的水平局中有效；多个UI局下有效（即水平底部对齐），多个UI水平局中有效（即整体布局垂直中线对齐）
44 @property (nonatomic, assign) BMKGravityType gravity;
45 @property (nonatomic, assign) UIEdgeInsets padding;
46 @property (nonatomic, assign) UIEdgeInsets margin;
47 @property (nonatomic, assign) BOOL clickable;
49 // 背景图片，防止图片变形使用-setBackgroundImage：capInsets：设置背景图片
50 @property (nonatomic, strong) UIImage *background;
51 // 背景图片混合颜色，需要配合背景图片使用，单独设置无效；配合白色或部分透明背景图片使用，可以实现背景颜色自定义或圆角效果
52 @property (nonatomic, strong) UIColor *backgroundColor;
53
57 - (void)setBackgroundImage:(UIImage *)image capInsets:(UIEdgeInsets)capInsets;
58
60 - (void)setTarget:(nullable id)target action:(SEL)clickAction;
61 @end
62
63 NS_ASSUME_NONNULL_END
BMKBaseUIView::width
int width
Definition: BMKBaseUIView.h:39
BMKVisibilityVisible
@ BMKVisibilityVisible
Definition: BMKBaseUIView.h:17
BMKBaseUIView::background
UIImage * background
Definition: BMKBaseUIView.h:50
BMKBaseUIView
Definition: BMKBaseUIView.h:37
BMKBaseUIView::margin
UIEdgeInsets margin
Definition: BMKBaseUIView.h:46
BMKGravityCenterHorizontal
@ BMKGravityCenterHorizontal
Definition: BMKBaseUIView.h:30
BMKGravityCenter
@ BMKGravityCenter
Definition: BMKBaseUIView.h:32
BMKBaseUIView::padding
UIEdgeInsets padding
Definition: BMKBaseUIView.h:45
BMKGravityType
BMKGravityType
Definition: BMKBaseUIView.h:25
BMKVisibility
BMKVisibility
Definition: BMKBaseUIView.h:16
BMKBaseUIView::gravity
BMKGravityType gravity
Definition: BMKBaseUIView.h:44
BMKGravityRight
@ BMKGravityRight
Definition: BMKBaseUIView.h:28
BMKGravityBottomHCenter
@ BMKGravityBottomHCenter
Definition: BMKBaseUIView.h:33
BMKGravityBottom
@ BMKGravityBottom
Definition: BMKBaseUIView.h:29
BMKGravityTop
@ BMKGravityTop
Definition: BMKBaseUIView.h:27
BMKBaseUIView::visibility
BMKVisibility visibility
Definition: BMKBaseUIView.h:37
BMKGravityLeft
@ BMKGravityLeft
Definition: BMKBaseUIView.h:26
BMKVisibilityInvisible
@ BMKVisibilityInvisible
Definition: BMKBaseUIView.h:18
BMKGravityCenterVertical
@ BMKGravityCenterVertical
Definition: BMKBaseUIView.h:31
BMKBaseUIView::clickable
BOOL clickable
Definition: BMKBaseUIView.h:47
BMKBaseUIView::height
int height
Definition: BMKBaseUIView.h:40
BMKVisibilityGone
@ BMKVisibilityGone
Definition: BMKBaseUIView.h:19
BMKBaseUIView::backgroundColor
UIColor * backgroundColor
Definition: BMKBaseUIView.h:52