add waterMark
This commit is contained in:
1 parent
7290bff594
commit
382116ab21
2 files changed
+59
-1
No files matched your search
@@ -813,6 +813,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Modified by: True砖家 on Bilibili" : {
|
||||||
|
"extractionState" : "manual",
|
||||||
|
"localizations" : {
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Modified & Localized by: True砖家 on Bilibili"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Modified & Localized by: True砖家 on Bilibili"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-HK" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Modified & Localized by: True砖家 on Bilibili"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Moonlight-iOS/tvOS only supports adding PCs on your local network on %s." : {
|
"Moonlight-iOS/tvOS only supports adding PCs on your local network on %s." : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include <Limelight.h>
|
#include <Limelight.h>
|
||||||
|
|
||||||
@implementation MainFrameViewController {
|
@implementation MainFrameViewController {
|
||||||
|
UILabel* waterMark;
|
||||||
NSOperationQueue* _opQueue;
|
NSOperationQueue* _opQueue;
|
||||||
TemporaryHost* _selectedHost;
|
TemporaryHost* _selectedHost;
|
||||||
BOOL _showHiddenApps;
|
BOOL _showHiddenApps;
|
||||||
@@ -921,10 +922,44 @@ static NSMutableSet* hostList;
|
|||||||
[self adjustScrollViewForSafeArea:self->hostScrollView];
|
[self adjustScrollViewForSafeArea:self->hostScrollView];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)waterMarkTapped {
|
||||||
|
// Handle the tap action here, e.g., open a URL
|
||||||
|
NSURL *url = [NSURL URLWithString:@"https://www.bilibili.com/video/BV1K4421D7Be"];
|
||||||
|
if ([[UIApplication sharedApplication] canOpenURL:url]) {
|
||||||
|
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)attachWaterMark {
|
||||||
|
// Create and configure the label
|
||||||
|
self->waterMark = [[UILabel alloc] init];
|
||||||
|
self->waterMark.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
|
self->waterMark.text = [LocalizationHelper localizedStringForKey:@"Modified by: True砖家 on Bilibili"];
|
||||||
|
self->waterMark.textColor = UIColor.blackColor;
|
||||||
|
self->waterMark.alpha = 0.2;
|
||||||
|
self->waterMark.font = [UIFont systemFontOfSize:20];
|
||||||
|
self->waterMark.textAlignment = NSTextAlignmentCenter;
|
||||||
|
self->waterMark.backgroundColor = [UIColor clearColor];
|
||||||
|
self->waterMark.userInteractionEnabled = YES; // Enable user interaction for tap gesture
|
||||||
|
// Add tap gesture recognizer to handle hyperlink action
|
||||||
|
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(waterMarkTapped)];
|
||||||
|
[self->waterMark addGestureRecognizer:tapGesture];
|
||||||
|
// Add the label to the view hierarchy
|
||||||
|
[self.view addSubview:self->waterMark];
|
||||||
|
// Set up constraints
|
||||||
|
[NSLayoutConstraint activateConstraints:@[
|
||||||
|
[self->waterMark.centerXAnchor constraintEqualToAnchor:self.view.rightAnchor constant:-250], // Aligns the horizontal center of label to the horizontal center of view
|
||||||
|
[self->waterMark.centerYAnchor constraintEqualToAnchor:self.view.bottomAnchor constant:-50], // Aligns the vertical center of label to the vertical center of view
|
||||||
|
[self->waterMark.widthAnchor constraintEqualToConstant:500], // Sets the width of label to 200 points
|
||||||
|
[self->waterMark.heightAnchor constraintEqualToConstant:60] // Sets the height of label to 50 points
|
||||||
|
]];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)viewDidLoad
|
- (void)viewDidLoad
|
||||||
{
|
{
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
|
[self attachWaterMark];
|
||||||
#if !TARGET_OS_TV
|
#if !TARGET_OS_TV
|
||||||
// Set the side bar button action. When it's tapped, it'll show the sidebar.
|
// Set the side bar button action. When it's tapped, it'll show the sidebar.
|
||||||
[_settingsButton setTarget:self.revealViewController];
|
[_settingsButton setTarget:self.revealViewController];
|
||||||
|
|||||||
Reference in new issue
Block a user