├── IMG_1756.PNG ├── LQIMInputView ├── LQIMInputView.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ ├── jwlq.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── lawchat.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── jwlq.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── lawchat.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── LQIMInputView.xcscheme │ │ └── xcschememanagement.plist └── LQIMInputView │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── dianhau.imageset │ │ ├── Contents.json │ │ ├── dianhau@2x.png │ │ └── dianhau@3x.png │ ├── jiajia.imageset │ │ ├── Contents.json │ │ ├── jiajia@2x.png │ │ └── jiajia@3x.png │ ├── kefu.imageset │ │ ├── Contents.json │ │ ├── kefu@2x.png │ │ └── kefu@3x.png │ ├── queren.imageset │ │ ├── Contents.json │ │ ├── queren@2x.png │ │ └── queren@3x.png │ ├── tupian.imageset │ │ ├── Contents.json │ │ ├── tupian@2x.png │ │ └── tupian@3x.png │ └── zhaoxian.imageset │ │ ├── Contents.json │ │ ├── zhaoxian@2x.png │ │ └── zhaoxian@3x.png │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── LQIMInputView │ ├── InputItem.h │ ├── InputItem.m │ ├── InputItemModel.h │ ├── InputItemModel.m │ ├── LQCollectionViewHorizontalLayout.h │ ├── LQCollectionViewHorizontalLayout.m │ ├── LQIMInputView.h │ └── LQIMInputView.m │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── README.md /IMG_1756.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/IMG_1756.PNG -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E602E0FF1DBEF6AC007DE597 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E602E0FE1DBEF6AC007DE597 /* main.m */; }; 11 | E602E1021DBEF6AC007DE597 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E602E1011DBEF6AC007DE597 /* AppDelegate.m */; }; 12 | E602E1051DBEF6AC007DE597 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E602E1041DBEF6AC007DE597 /* ViewController.m */; }; 13 | E602E1081DBEF6AC007DE597 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E602E1061DBEF6AC007DE597 /* Main.storyboard */; }; 14 | E602E10A1DBEF6AC007DE597 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E602E1091DBEF6AC007DE597 /* Assets.xcassets */; }; 15 | E602E10D1DBEF6AC007DE597 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E602E10B1DBEF6AC007DE597 /* LaunchScreen.storyboard */; }; 16 | E602E1171DBEF776007DE597 /* LQIMInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = E602E1161DBEF776007DE597 /* LQIMInputView.m */; }; 17 | E602E11A1DBEF8EE007DE597 /* InputItem.m in Sources */ = {isa = PBXBuildFile; fileRef = E602E1191DBEF8EE007DE597 /* InputItem.m */; }; 18 | E602E11D1DBF057A007DE597 /* InputItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E602E11C1DBF057A007DE597 /* InputItemModel.m */; }; 19 | E602E1251DBF4235007DE597 /* LQCollectionViewHorizontalLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = E602E1241DBF4235007DE597 /* LQCollectionViewHorizontalLayout.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | E602E0FA1DBEF6AC007DE597 /* LQIMInputView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LQIMInputView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | E602E0FE1DBEF6AC007DE597 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 25 | E602E1001DBEF6AC007DE597 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 26 | E602E1011DBEF6AC007DE597 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 27 | E602E1031DBEF6AC007DE597 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 28 | E602E1041DBEF6AC007DE597 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 29 | E602E1071DBEF6AC007DE597 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 30 | E602E1091DBEF6AC007DE597 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 31 | E602E10C1DBEF6AC007DE597 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 32 | E602E10E1DBEF6AC007DE597 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | E602E1151DBEF776007DE597 /* LQIMInputView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LQIMInputView.h; sourceTree = ""; }; 34 | E602E1161DBEF776007DE597 /* LQIMInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LQIMInputView.m; sourceTree = ""; }; 35 | E602E1181DBEF8EE007DE597 /* InputItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputItem.h; sourceTree = ""; }; 36 | E602E1191DBEF8EE007DE597 /* InputItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InputItem.m; sourceTree = ""; }; 37 | E602E11B1DBF057A007DE597 /* InputItemModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputItemModel.h; sourceTree = ""; }; 38 | E602E11C1DBF057A007DE597 /* InputItemModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InputItemModel.m; sourceTree = ""; }; 39 | E602E1231DBF4235007DE597 /* LQCollectionViewHorizontalLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LQCollectionViewHorizontalLayout.h; sourceTree = ""; }; 40 | E602E1241DBF4235007DE597 /* LQCollectionViewHorizontalLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LQCollectionViewHorizontalLayout.m; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | E602E0F71DBEF6AC007DE597 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | /* End PBXFrameworksBuildPhase section */ 52 | 53 | /* Begin PBXGroup section */ 54 | E602E0F11DBEF6AC007DE597 = { 55 | isa = PBXGroup; 56 | children = ( 57 | E602E0FC1DBEF6AC007DE597 /* LQIMInputView */, 58 | E602E0FB1DBEF6AC007DE597 /* Products */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | E602E0FB1DBEF6AC007DE597 /* Products */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | E602E0FA1DBEF6AC007DE597 /* LQIMInputView.app */, 66 | ); 67 | name = Products; 68 | sourceTree = ""; 69 | }; 70 | E602E0FC1DBEF6AC007DE597 /* LQIMInputView */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | E602E1001DBEF6AC007DE597 /* AppDelegate.h */, 74 | E602E1011DBEF6AC007DE597 /* AppDelegate.m */, 75 | E602E1031DBEF6AC007DE597 /* ViewController.h */, 76 | E602E1041DBEF6AC007DE597 /* ViewController.m */, 77 | E602E1141DBEF700007DE597 /* LQIMInputView */, 78 | E602E1061DBEF6AC007DE597 /* Main.storyboard */, 79 | E602E1091DBEF6AC007DE597 /* Assets.xcassets */, 80 | E602E10B1DBEF6AC007DE597 /* LaunchScreen.storyboard */, 81 | E602E10E1DBEF6AC007DE597 /* Info.plist */, 82 | E602E0FD1DBEF6AC007DE597 /* Supporting Files */, 83 | ); 84 | path = LQIMInputView; 85 | sourceTree = ""; 86 | }; 87 | E602E0FD1DBEF6AC007DE597 /* Supporting Files */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | E602E0FE1DBEF6AC007DE597 /* main.m */, 91 | ); 92 | name = "Supporting Files"; 93 | sourceTree = ""; 94 | }; 95 | E602E1141DBEF700007DE597 /* LQIMInputView */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | E602E1181DBEF8EE007DE597 /* InputItem.h */, 99 | E602E1191DBEF8EE007DE597 /* InputItem.m */, 100 | E602E11B1DBF057A007DE597 /* InputItemModel.h */, 101 | E602E11C1DBF057A007DE597 /* InputItemModel.m */, 102 | E602E1231DBF4235007DE597 /* LQCollectionViewHorizontalLayout.h */, 103 | E602E1241DBF4235007DE597 /* LQCollectionViewHorizontalLayout.m */, 104 | E602E1151DBEF776007DE597 /* LQIMInputView.h */, 105 | E602E1161DBEF776007DE597 /* LQIMInputView.m */, 106 | ); 107 | path = LQIMInputView; 108 | sourceTree = ""; 109 | }; 110 | /* End PBXGroup section */ 111 | 112 | /* Begin PBXNativeTarget section */ 113 | E602E0F91DBEF6AC007DE597 /* LQIMInputView */ = { 114 | isa = PBXNativeTarget; 115 | buildConfigurationList = E602E1111DBEF6AC007DE597 /* Build configuration list for PBXNativeTarget "LQIMInputView" */; 116 | buildPhases = ( 117 | E602E0F61DBEF6AC007DE597 /* Sources */, 118 | E602E0F71DBEF6AC007DE597 /* Frameworks */, 119 | E602E0F81DBEF6AC007DE597 /* Resources */, 120 | ); 121 | buildRules = ( 122 | ); 123 | dependencies = ( 124 | ); 125 | name = LQIMInputView; 126 | productName = LQIMInputView; 127 | productReference = E602E0FA1DBEF6AC007DE597 /* LQIMInputView.app */; 128 | productType = "com.apple.product-type.application"; 129 | }; 130 | /* End PBXNativeTarget section */ 131 | 132 | /* Begin PBXProject section */ 133 | E602E0F21DBEF6AC007DE597 /* Project object */ = { 134 | isa = PBXProject; 135 | attributes = { 136 | LastUpgradeCheck = 0800; 137 | ORGANIZATIONNAME = "674297026@qq.com"; 138 | TargetAttributes = { 139 | E602E0F91DBEF6AC007DE597 = { 140 | CreatedOnToolsVersion = 8.0; 141 | ProvisioningStyle = Automatic; 142 | }; 143 | }; 144 | }; 145 | buildConfigurationList = E602E0F51DBEF6AC007DE597 /* Build configuration list for PBXProject "LQIMInputView" */; 146 | compatibilityVersion = "Xcode 8.0"; 147 | developmentRegion = English; 148 | hasScannedForEncodings = 0; 149 | knownRegions = ( 150 | en, 151 | Base, 152 | ); 153 | mainGroup = E602E0F11DBEF6AC007DE597; 154 | productRefGroup = E602E0FB1DBEF6AC007DE597 /* Products */; 155 | projectDirPath = ""; 156 | projectRoot = ""; 157 | targets = ( 158 | E602E0F91DBEF6AC007DE597 /* LQIMInputView */, 159 | ); 160 | }; 161 | /* End PBXProject section */ 162 | 163 | /* Begin PBXResourcesBuildPhase section */ 164 | E602E0F81DBEF6AC007DE597 /* Resources */ = { 165 | isa = PBXResourcesBuildPhase; 166 | buildActionMask = 2147483647; 167 | files = ( 168 | E602E10D1DBEF6AC007DE597 /* LaunchScreen.storyboard in Resources */, 169 | E602E10A1DBEF6AC007DE597 /* Assets.xcassets in Resources */, 170 | E602E1081DBEF6AC007DE597 /* Main.storyboard in Resources */, 171 | ); 172 | runOnlyForDeploymentPostprocessing = 0; 173 | }; 174 | /* End PBXResourcesBuildPhase section */ 175 | 176 | /* Begin PBXSourcesBuildPhase section */ 177 | E602E0F61DBEF6AC007DE597 /* Sources */ = { 178 | isa = PBXSourcesBuildPhase; 179 | buildActionMask = 2147483647; 180 | files = ( 181 | E602E1171DBEF776007DE597 /* LQIMInputView.m in Sources */, 182 | E602E11D1DBF057A007DE597 /* InputItemModel.m in Sources */, 183 | E602E1051DBEF6AC007DE597 /* ViewController.m in Sources */, 184 | E602E11A1DBEF8EE007DE597 /* InputItem.m in Sources */, 185 | E602E1251DBF4235007DE597 /* LQCollectionViewHorizontalLayout.m in Sources */, 186 | E602E1021DBEF6AC007DE597 /* AppDelegate.m in Sources */, 187 | E602E0FF1DBEF6AC007DE597 /* main.m in Sources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXSourcesBuildPhase section */ 192 | 193 | /* Begin PBXVariantGroup section */ 194 | E602E1061DBEF6AC007DE597 /* Main.storyboard */ = { 195 | isa = PBXVariantGroup; 196 | children = ( 197 | E602E1071DBEF6AC007DE597 /* Base */, 198 | ); 199 | name = Main.storyboard; 200 | sourceTree = ""; 201 | }; 202 | E602E10B1DBEF6AC007DE597 /* LaunchScreen.storyboard */ = { 203 | isa = PBXVariantGroup; 204 | children = ( 205 | E602E10C1DBEF6AC007DE597 /* Base */, 206 | ); 207 | name = LaunchScreen.storyboard; 208 | sourceTree = ""; 209 | }; 210 | /* End PBXVariantGroup section */ 211 | 212 | /* Begin XCBuildConfiguration section */ 213 | E602E10F1DBEF6AC007DE597 /* Debug */ = { 214 | isa = XCBuildConfiguration; 215 | buildSettings = { 216 | ALWAYS_SEARCH_USER_PATHS = NO; 217 | CLANG_ANALYZER_NONNULL = YES; 218 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 219 | CLANG_CXX_LIBRARY = "libc++"; 220 | CLANG_ENABLE_MODULES = YES; 221 | CLANG_ENABLE_OBJC_ARC = YES; 222 | CLANG_WARN_BOOL_CONVERSION = YES; 223 | CLANG_WARN_CONSTANT_CONVERSION = YES; 224 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 225 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 226 | CLANG_WARN_EMPTY_BODY = YES; 227 | CLANG_WARN_ENUM_CONVERSION = YES; 228 | CLANG_WARN_INFINITE_RECURSION = YES; 229 | CLANG_WARN_INT_CONVERSION = YES; 230 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 231 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 232 | CLANG_WARN_UNREACHABLE_CODE = YES; 233 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 234 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 235 | COPY_PHASE_STRIP = NO; 236 | DEBUG_INFORMATION_FORMAT = dwarf; 237 | ENABLE_STRICT_OBJC_MSGSEND = YES; 238 | ENABLE_TESTABILITY = YES; 239 | GCC_C_LANGUAGE_STANDARD = gnu99; 240 | GCC_DYNAMIC_NO_PIC = NO; 241 | GCC_NO_COMMON_BLOCKS = YES; 242 | GCC_OPTIMIZATION_LEVEL = 0; 243 | GCC_PREPROCESSOR_DEFINITIONS = ( 244 | "DEBUG=1", 245 | "$(inherited)", 246 | ); 247 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 248 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 249 | GCC_WARN_UNDECLARED_SELECTOR = YES; 250 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 251 | GCC_WARN_UNUSED_FUNCTION = YES; 252 | GCC_WARN_UNUSED_VARIABLE = YES; 253 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 254 | MTL_ENABLE_DEBUG_INFO = YES; 255 | ONLY_ACTIVE_ARCH = YES; 256 | SDKROOT = iphoneos; 257 | }; 258 | name = Debug; 259 | }; 260 | E602E1101DBEF6AC007DE597 /* Release */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | ALWAYS_SEARCH_USER_PATHS = NO; 264 | CLANG_ANALYZER_NONNULL = YES; 265 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 266 | CLANG_CXX_LIBRARY = "libc++"; 267 | CLANG_ENABLE_MODULES = YES; 268 | CLANG_ENABLE_OBJC_ARC = YES; 269 | CLANG_WARN_BOOL_CONVERSION = YES; 270 | CLANG_WARN_CONSTANT_CONVERSION = YES; 271 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 272 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 273 | CLANG_WARN_EMPTY_BODY = YES; 274 | CLANG_WARN_ENUM_CONVERSION = YES; 275 | CLANG_WARN_INFINITE_RECURSION = YES; 276 | CLANG_WARN_INT_CONVERSION = YES; 277 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 278 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 279 | CLANG_WARN_UNREACHABLE_CODE = YES; 280 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 281 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 282 | COPY_PHASE_STRIP = NO; 283 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 284 | ENABLE_NS_ASSERTIONS = NO; 285 | ENABLE_STRICT_OBJC_MSGSEND = YES; 286 | GCC_C_LANGUAGE_STANDARD = gnu99; 287 | GCC_NO_COMMON_BLOCKS = YES; 288 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 289 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 290 | GCC_WARN_UNDECLARED_SELECTOR = YES; 291 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 292 | GCC_WARN_UNUSED_FUNCTION = YES; 293 | GCC_WARN_UNUSED_VARIABLE = YES; 294 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 295 | MTL_ENABLE_DEBUG_INFO = NO; 296 | SDKROOT = iphoneos; 297 | VALIDATE_PRODUCT = YES; 298 | }; 299 | name = Release; 300 | }; 301 | E602E1121DBEF6AC007DE597 /* Debug */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 305 | DEVELOPMENT_TEAM = 8V8QNTU33M; 306 | INFOPLIST_FILE = LQIMInputView/Info.plist; 307 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 308 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 309 | PRODUCT_BUNDLE_IDENTIFIER = "-74297026-qq.com.LQIMInputView"; 310 | PRODUCT_NAME = "$(TARGET_NAME)"; 311 | }; 312 | name = Debug; 313 | }; 314 | E602E1131DBEF6AC007DE597 /* Release */ = { 315 | isa = XCBuildConfiguration; 316 | buildSettings = { 317 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 318 | DEVELOPMENT_TEAM = 8V8QNTU33M; 319 | INFOPLIST_FILE = LQIMInputView/Info.plist; 320 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | PRODUCT_BUNDLE_IDENTIFIER = "-74297026-qq.com.LQIMInputView"; 323 | PRODUCT_NAME = "$(TARGET_NAME)"; 324 | }; 325 | name = Release; 326 | }; 327 | /* End XCBuildConfiguration section */ 328 | 329 | /* Begin XCConfigurationList section */ 330 | E602E0F51DBEF6AC007DE597 /* Build configuration list for PBXProject "LQIMInputView" */ = { 331 | isa = XCConfigurationList; 332 | buildConfigurations = ( 333 | E602E10F1DBEF6AC007DE597 /* Debug */, 334 | E602E1101DBEF6AC007DE597 /* Release */, 335 | ); 336 | defaultConfigurationIsVisible = 0; 337 | defaultConfigurationName = Release; 338 | }; 339 | E602E1111DBEF6AC007DE597 /* Build configuration list for PBXNativeTarget "LQIMInputView" */ = { 340 | isa = XCConfigurationList; 341 | buildConfigurations = ( 342 | E602E1121DBEF6AC007DE597 /* Debug */, 343 | E602E1131DBEF6AC007DE597 /* Release */, 344 | ); 345 | defaultConfigurationIsVisible = 0; 346 | defaultConfigurationName = Release; 347 | }; 348 | /* End XCConfigurationList section */ 349 | }; 350 | rootObject = E602E0F21DBEF6AC007DE597 /* Project object */; 351 | } 352 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView.xcodeproj/project.xcworkspace/xcuserdata/jwlq.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView.xcodeproj/project.xcworkspace/xcuserdata/jwlq.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView.xcodeproj/project.xcworkspace/xcuserdata/lawchat.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView.xcodeproj/project.xcworkspace/xcuserdata/lawchat.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView.xcodeproj/xcuserdata/jwlq.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LQIMInputView.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | E602E0F91DBEF6AC007DE597 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView.xcodeproj/xcuserdata/lawchat.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView.xcodeproj/xcuserdata/lawchat.xcuserdatad/xcschemes/LQIMInputView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView.xcodeproj/xcuserdata/lawchat.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LQIMInputView.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | E602E0F91DBEF6AC007DE597 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 jacli. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 jacli. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/dianhau.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "dianhau@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "dianhau@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/dianhau.imageset/dianhau@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/dianhau.imageset/dianhau@2x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/dianhau.imageset/dianhau@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/dianhau.imageset/dianhau@3x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/jiajia.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "jiajia@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "jiajia@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/jiajia.imageset/jiajia@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/jiajia.imageset/jiajia@2x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/jiajia.imageset/jiajia@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/jiajia.imageset/jiajia@3x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/kefu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "kefu@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "kefu@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/kefu.imageset/kefu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/kefu.imageset/kefu@2x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/kefu.imageset/kefu@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/kefu.imageset/kefu@3x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/queren.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "queren@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "queren@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/queren.imageset/queren@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/queren.imageset/queren@2x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/queren.imageset/queren@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/queren.imageset/queren@3x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/tupian.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tupian@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tupian@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/tupian.imageset/tupian@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/tupian.imageset/tupian@2x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/tupian.imageset/tupian@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/tupian.imageset/tupian@3x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/zhaoxian.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "zhaoxian@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "zhaoxian@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/zhaoxian.imageset/zhaoxian@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/zhaoxian.imageset/zhaoxian@2x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Assets.xcassets/zhaoxian.imageset/zhaoxian@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XZTLLQ/LQIMInputView/f9631bc6069034a71caccd6c270d7b1f2805b889/LQIMInputView/LQIMInputView/Assets.xcassets/zhaoxian.imageset/zhaoxian@3x.png -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/LQIMInputView/InputItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // InputItem.h 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 674297026@qq.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "InputItemModel.h" 11 | 12 | 13 | 14 | @interface InputItem : UICollectionViewCell 15 | 16 | @property(nonatomic,strong) InputItemModel *model; 17 | 18 | //图文 19 | @property(nonatomic,strong) UIButton *contentBtn; 20 | 21 | 22 | 23 | 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/LQIMInputView/InputItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // InputItem.m 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 674297026@qq.com. All rights reserved. 7 | // 8 | 9 | #import "InputItem.h" 10 | 11 | @implementation InputItem 12 | 13 | #pragma mark - 设置图文上下排版和间距 14 | - (void)setImageSpacing:(CGFloat)spacing { 15 | [self layoutIfNeeded]; 16 | 17 | [_contentBtn setTitleEdgeInsets:UIEdgeInsetsMake(_contentBtn.imageView.frame.size.height ,-_contentBtn.imageView.frame.size.width, -2*spacing,0.0)];//文字距离上边框的距离增加imageView的高度,距离左边框减少imageView的宽度,距离下边框和右边框距离不变 18 | [_contentBtn setImageEdgeInsets:UIEdgeInsetsMake(-2*spacing, 0.0,0.0, -_contentBtn.titleLabel.bounds.size.width)];//图片距离右边框距离减少图片的宽度,其它不边 19 | } 20 | 21 | - (void)layoutSubviews { 22 | [super layoutSubviews]; 23 | 24 | [self.contentBtn setImage:[UIImage imageNamed:_model.imageName] forState:UIControlStateNormal]; 25 | 26 | [self.contentBtn setTitle:_model.title forState:UIControlStateNormal]; 27 | 28 | [self setImageSpacing:6]; 29 | 30 | } 31 | 32 | - (UIButton *)contentBtn { 33 | if (!_contentBtn) { 34 | _contentBtn = [[UIButton alloc] initWithFrame:self.bounds]; 35 | _contentBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;//使图片和文字水平居中显示 36 | _contentBtn.userInteractionEnabled = NO; 37 | _contentBtn.titleLabel.font = [UIFont systemFontOfSize:12]; 38 | [_contentBtn setTitleColor:[UIColor colorWithRed:90.0/255.0 green:90.0/255.0 blue:90.0/255.0 alpha:1.0] forState:UIControlStateNormal]; 39 | [self addSubview:_contentBtn]; 40 | } 41 | return _contentBtn; 42 | } 43 | 44 | #pragma mark - 数据源赋值 45 | - (void)setModel:(InputItemModel *)model { 46 | 47 | _model = model; 48 | 49 | [self layoutSubviews]; 50 | } 51 | 52 | 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/LQIMInputView/InputItemModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // InputItemModel.h 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 674297026@qq.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface InputItemModel : NSObject 13 | 14 | @property(nonatomic,strong) NSString *title; 15 | 16 | @property(nonatomic,strong) NSString *imageName; 17 | 18 | typedef void (^ItemClicked)(void); 19 | @property(nonatomic, copy) ItemClicked clickedBlock; 20 | 21 | 22 | + (instancetype)initWithTitle:(NSString *)title imageName:(NSString *)imageName clickedBlock:(ItemClicked)clickedBlock; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/LQIMInputView/InputItemModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // InputItemModel.m 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 674297026@qq.com. All rights reserved. 7 | // 8 | 9 | #import "InputItemModel.h" 10 | 11 | @implementation InputItemModel 12 | 13 | - (instancetype)initWithTitle:(NSString *)title imageName:(NSString *)imageName clickedBlock:(ItemClicked)clickedBlock 14 | { 15 | self = [super init]; 16 | if (self) { 17 | self.title = title; 18 | self.imageName = imageName; 19 | 20 | self.clickedBlock = clickedBlock; 21 | } 22 | return self; 23 | } 24 | 25 | + (instancetype)initWithTitle:(NSString *)title imageName:(NSString *)imageName clickedBlock:(ItemClicked)clickedBlock{ 26 | return [[InputItemModel alloc] initWithTitle:title imageName:imageName clickedBlock:clickedBlock]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/LQIMInputView/LQCollectionViewHorizontalLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // LQCollectionViewHorizontalLayout.h 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 674297026@qq.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LQCollectionViewHorizontalLayout : UICollectionViewFlowLayout 12 | // 一行中 cell的个数 13 | @property (nonatomic) NSUInteger itemCountPerRow; 14 | // 一页显示多少行 15 | @property (nonatomic) NSUInteger rowCount; 16 | @end 17 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/LQIMInputView/LQCollectionViewHorizontalLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // LQCollectionViewHorizontalLayout.m 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 674297026@qq.com. All rights reserved. 7 | // 8 | 9 | #import "LQCollectionViewHorizontalLayout.h" 10 | 11 | 12 | @interface LQCollectionViewHorizontalLayout () 13 | @property (strong, nonatomic) NSMutableArray *allAttributes; 14 | @end 15 | 16 | @implementation LQCollectionViewHorizontalLayout 17 | - (void)prepareLayout 18 | { 19 | [super prepareLayout]; 20 | 21 | self.rowCount = 2; 22 | self.itemCountPerRow = 4; 23 | 24 | } 25 | 26 | - (CGSize)collectionViewContentSize 27 | { 28 | 29 | return CGSizeMake(self.collectionView.bounds.size.width * ((([self.collectionView numberOfItemsInSection:0] - 1) / (_itemCountPerRow * _rowCount)) +1), self.collectionView.bounds.size.height); 30 | } 31 | 32 | - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath 33 | { 34 | NSUInteger item = indexPath.item; 35 | NSUInteger x; 36 | NSUInteger y; 37 | [self targetPositionWithItem:item resultX:&x resultY:&y]; 38 | NSUInteger item2 = [self originItemAtX:x y:y]; 39 | NSIndexPath *theNewIndexPath = [NSIndexPath indexPathForItem:item2 inSection:indexPath.section]; 40 | 41 | UICollectionViewLayoutAttributes *theNewAttr = [super layoutAttributesForItemAtIndexPath:theNewIndexPath]; 42 | theNewAttr.indexPath = indexPath; 43 | 44 | return theNewAttr; 45 | } 46 | 47 | - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect 48 | { 49 | 50 | return self.allAttributes; 51 | 52 | } 53 | 54 | - (NSMutableArray *)allAttributes { 55 | if (!_allAttributes) { 56 | _allAttributes = [NSMutableArray array]; 57 | 58 | NSUInteger count = [self.collectionView numberOfItemsInSection:0]; 59 | for (NSUInteger i = 0; i 10 | #import "InputItem.h" 11 | 12 | 13 | @interface LQIMInputView : UIView 14 | 15 | @property(nonatomic,strong) UICollectionView *collectionView; 16 | 17 | @property(nonatomic,strong) UIPageControl *pageCtr; 18 | 19 | @property(nonatomic,strong) NSMutableArray *itemModels; 20 | 21 | 22 | - (instancetype)initWithFrame:(CGRect)frame; 23 | 24 | - (void)addItem:(InputItemModel*)model; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/LQIMInputView/LQIMInputView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LQIMInputView.m 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 674297026@qq.com. All rights reserved. 7 | // 8 | 9 | #import "LQIMInputView.h" 10 | #import "LQCollectionViewHorizontalLayout.h" 11 | 12 | @implementation LQIMInputView 13 | 14 | - (instancetype)initWithFrame:(CGRect)frame 15 | { 16 | self = [super initWithFrame:frame]; 17 | if (self) { 18 | [self addSubview:self.collectionView]; 19 | [self addSubview:self.pageCtr]; 20 | } 21 | return self; 22 | } 23 | 24 | - (void)addItem:(InputItemModel*)model { 25 | if (!self.itemModels) { 26 | self.itemModels = [NSMutableArray array]; 27 | } 28 | [self.itemModels addObject:model]; 29 | [self.collectionView reloadData]; 30 | 31 | NSInteger pageNum = (_itemModels.count-1) / 8 + 1; 32 | if (pageNum>1) { 33 | _pageCtr.numberOfPages = pageNum; 34 | _pageCtr.currentPage = 0; 35 | } 36 | } 37 | 38 | #pragma mark - 页码控件 39 | - (UIPageControl *)pageCtr { 40 | if (!_pageCtr) { 41 | _pageCtr = [[UIPageControl alloc]initWithFrame:CGRectMake(0, 0,200, 20)]; 42 | _pageCtr.center = CGPointMake(self.bounds.size.width / 2.0, self.collectionView.bounds.size.height +10); 43 | 44 | _pageCtr.pageIndicatorTintColor = [UIColor colorWithRed:221.0/255.0 green:221.0/255.0 blue:221.0/255.0 alpha:1.0]; 45 | _pageCtr.currentPageIndicatorTintColor = [UIColor colorWithRed:51.0/255.0 green:51.0/255.0 blue:51.0/255.0 alpha:1.0]; 46 | 47 | _pageCtr.userInteractionEnabled = NO; 48 | } 49 | return _pageCtr; 50 | } 51 | 52 | #pragma mark - collectionView 53 | - (UICollectionView *)collectionView { 54 | if (!_collectionView) { 55 | 56 | //功能列表 57 | 58 | LQCollectionViewHorizontalLayout *layout = [[LQCollectionViewHorizontalLayout alloc] init]; 59 | layout.itemSize = CGSizeMake([UIScreen mainScreen].bounds.size.width/4.0, (CGRectGetHeight(self.bounds)-40) / 2.0); 60 | layout.minimumLineSpacing = 0; 61 | layout.minimumInteritemSpacing = 0; 62 | layout.headerReferenceSize = CGSizeMake(0, 0); 63 | layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; 64 | 65 | 66 | _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)-40) collectionViewLayout:layout]; 67 | _collectionView.backgroundColor = [UIColor clearColor]; 68 | _collectionView.pagingEnabled = YES; 69 | _collectionView.delegate = self; 70 | _collectionView.dataSource = self; 71 | _collectionView.showsHorizontalScrollIndicator = NO; 72 | _collectionView.showsVerticalScrollIndicator = NO; 73 | 74 | [_collectionView registerClass:[InputItem class] forCellWithReuseIdentifier:@"InputItem"]; 75 | 76 | } 77 | 78 | return _collectionView; 79 | } 80 | 81 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { 82 | return _itemModels.count; 83 | } 84 | 85 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 86 | InputItem *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"InputItem" forIndexPath:indexPath]; 87 | 88 | cell.model = self.itemModels[indexPath.item]; 89 | return cell; 90 | } 91 | 92 | 93 | #pragma mark - 选择了某功能 94 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { 95 | InputItemModel *item = self.itemModels[indexPath.item]; 96 | if (item.clickedBlock) { 97 | item.clickedBlock(); 98 | } 99 | } 100 | 101 | #pragma mark - 滚动视图 102 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 103 | { 104 | /** 105 | * 滚动设置当前页码 106 | */ 107 | int page = (int)(self.collectionView.contentOffset.x / scrollView.bounds.size.width + 0.5) % _itemModels.count; 108 | _pageCtr.currentPage = page; 109 | } 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 jacli. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 jacli. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | #import "LQIMInputView.h" 12 | 13 | @interface ViewController () 14 | 15 | @property(nonatomic,strong) LQIMInputView *inputView; 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | self.inputView = [[LQIMInputView alloc] initWithFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.height-210, [UIScreen mainScreen].bounds.size.width, 210)]; 25 | self.inputView.backgroundColor = [UIColor colorWithRed:248.0/255.0 green:248.0/255.0 blue:248.0/255.0 alpha:1.0]; 26 | [self.inputView addItem:[InputItemModel initWithTitle:@"相册" imageName:@"tupian" clickedBlock:^{ 27 | NSLog(@"相册"); 28 | }]]; 29 | [self.inputView addItem:[InputItemModel initWithTitle:@"拍照" imageName:@"zhaoxian" clickedBlock:^{ 30 | NSLog(@"拍照"); 31 | }]]; 32 | [self.inputView addItem:[InputItemModel initWithTitle:@"加价" imageName:@"jiajia" clickedBlock:^{ 33 | NSLog(@"加价"); 34 | }]]; 35 | [self.inputView addItem:[InputItemModel initWithTitle:@"确认完成" imageName:@"queren" clickedBlock:^{ 36 | NSLog(@"确认完成"); 37 | }]]; 38 | [self.inputView addItem:[InputItemModel initWithTitle:@"联系客服" imageName:@"kefu" clickedBlock:^{ 39 | NSLog(@"联系客服"); 40 | }]]; 41 | [self.inputView addItem:[InputItemModel initWithTitle:@"电话联系" imageName:@"dianhau" clickedBlock:^{ 42 | NSLog(@"电话联系"); 43 | }]]; 44 | [self.inputView addItem:[InputItemModel initWithTitle:@"相册" imageName:@"tupian" clickedBlock:^{ 45 | NSLog(@"相册"); 46 | }]]; 47 | [self.inputView addItem:[InputItemModel initWithTitle:@"拍照" imageName:@"zhaoxian" clickedBlock:^{ 48 | NSLog(@"拍照"); 49 | }]]; 50 | [self.inputView addItem:[InputItemModel initWithTitle:@"加价" imageName:@"jiajia" clickedBlock:^{ 51 | NSLog(@"加价"); 52 | }]]; 53 | [self.inputView addItem:[InputItemModel initWithTitle:@"确认完成" imageName:@"queren" clickedBlock:^{ 54 | NSLog(@"确认完成"); 55 | }]]; 56 | [self.inputView addItem:[InputItemModel initWithTitle:@"联系客服" imageName:@"kefu" clickedBlock:^{ 57 | NSLog(@"联系客服"); 58 | }]]; 59 | [self.inputView addItem:[InputItemModel initWithTitle:@"电话联系" imageName:@"dianhau" clickedBlock:^{ 60 | NSLog(@"电话联系"); 61 | }]]; 62 | 63 | [self.view addSubview:self.inputView]; 64 | } 65 | 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /LQIMInputView/LQIMInputView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LQIMInputView 4 | // 5 | // Created by lawchat on 2016/10/25. 6 | // Copyright © 2016年 jacli. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LQ系列--UI 2 | #### LQPhotoPickerDemo - https://github.com/XZTLLQ/LQClass (可节约项目大量细节调控时间,体验好!) 3 | #### LQPhotoPickerDemo - https://github.com/XZTLLQ/LQPhotoPickerDemo (选择图片上传) 4 | #### LQIMInputView - https://github.com/XZTLLQ/LQIMInputView (聊天页面工具栏) 5 | # LQIMInputView 6 | ### 效果图 7 | 如图功能,集成方便 8 | ![](https://github.com/xztl/LQIMInputView/blob/master/IMG_1756.PNG) 9 | ### 使用方法: 10 | 1.“LQIMInputView”目录文件即为集成所需文件: 11 | 12 | ``` 13 | InputItem .h&.m 14 | InputItemModel .h&.m 15 | LQCollectionViewHorizontalLayout .h&.m 16 | LQIMInputVie .h&.m 17 | ``` 18 | 2.使用方法: 19 | ``` 20 | //第一步 21 | self.inputView = [[LQIMInputView alloc] initWithFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.height-210, [UIScreen mainScreen].bounds.size.width, 210)]; 22 | //第二步 23 | self.inputView.backgroundColor = [UIColor colorWithRed:248.0/255.0 green:248.0/255.0 blue:248.0/255.0 alpha:1.0]; 24 | //第三步 25 | [self.inputView addItem:[InputItemModel initWithTitle:@"相册" imageName:@"tupian" clickedBlock:^{ 26 | NSLog(@"相册"); 27 | }]]; 28 | [self.inputView addItem:[InputItemModel initWithTitle:@"拍照" imageName:@"zhaoxian" clickedBlock:^{ 29 | NSLog(@"拍照"); 30 | }]]; 31 | [self.inputView addItem:[InputItemModel initWithTitle:@"加价" imageName:@"jiajia" clickedBlock:^{ 32 | NSLog(@"加价"); 33 | }]]; 34 | [self.inputView addItem:[InputItemModel initWithTitle:@"确认完成" imageName:@"queren" clickedBlock:^{ 35 | NSLog(@"确认完成"); 36 | }]]; 37 | [self.inputView addItem:[InputItemModel initWithTitle:@"联系客服" imageName:@"kefu" clickedBlock:^{ 38 | NSLog(@"联系客服"); 39 | }]]; 40 | [self.inputView addItem:[InputItemModel initWithTitle:@"电话联系" imageName:@"dianhau" clickedBlock:^{ 41 | NSLog(@"电话联系"); 42 | }]]; 43 | //第四步 44 | [self.view addSubview:self.inputView]; 45 | ``` 46 | 47 | 48 | 49 | --------------------------------------------------------------------------------