就像问题所说的那样.我可以看看其他人,程序是否全屏运行?
全屏意味着整个屏幕被遮挡,可能以与桌面不同的视频模式运行.
我在使用KeyBoardFocusManger全屏工作时遇到了问题Window.无论如何,它都不会得到键盘输入.我使用a System.exit(0)和a println()来查找对keypressed/release/typed方法的任何调用,但不会抛出任何错误.我试过了KeyListeners; 但我看了以后这个,我改变了一个KeyboardFocusManager,同样的事情仍然发生.我真的很绝望; 从我可以判断,Window是不是得到了键盘的焦点?
这是我的主要内容:
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
// Determine if full-screen mode is supported directly
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gs = ge.getDefaultScreenDevice();
if (gs.isFullScreenSupported()) {
Frame frame = new Frame(gs.getDefaultConfiguration());
SpaceInvaderUI spaceInvaderUI = new SpaceInvaderUI(frame);
// Enter full-screen mode
gs.setFullScreenWindow(spaceInvaderUI);
} else {
JOptionPane.showMessageDialog(null, "Does not support full screen!", "Error 0x01", JOptionPane.ERROR_MESSAGE); …Run Code Online (Sandbox Code Playgroud) 我基于在Web浏览器中使用Fullscreen API(http://hacks.mozilla.org/2012/01/using-the-fullscreen-api-in-web-browsers)进行全屏,但仅适用于单击事件或控制台firebug,而不是提交事件或鼠标悬停或类似的自动化.是否可以使用html5自动全屏而不点击事件或类似?
编辑:如果不可能,我理解安全性和可访问性的原因,但在某些环境中,这可能是有希望的.
美好的一天!
我尝试了我的第一个应用程序JavaFx.我设置了全屏模式并按下按钮显示一个对话框.当对话框出现时,主窗口将失去其全屏.
码:
public class Test1 extends Application {
@Override
public void start(final Stage primaryStage) {
Button btn = new Button();
btn.setText("Say 'Hello World'");
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
Stage dialogStage = new Stage(StageStyle.UTILITY);
dialogStage.initModality(Modality.APPLICATION_MODAL);
dialogStage.setScene(new Scene(VBoxBuilder.create().
children(new Text("Hi"), new Button("Ok.")).
alignment(Pos.CENTER).padding(new Insets(5)).build()));
dialogStage.show();
System.out.println(dialogStage.getOwner()==primaryStage.getOwner());
}
});
StackPane root = new StackPane();
root.getChildren().add(btn);
Rectangle2D r = Screen.getPrimary().getBounds();
Scene scene = new Scene(root, r.getWidth(), r.getHeight());
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.setFullScreen(true);
primaryStage.show();
}
public static void main(String[] args) { …Run Code Online (Sandbox Code Playgroud) 如何放大UICollectionViewCell以便全屏显示?我已经扩展UICollectionViewFlowLayout并在我的视图控制器中,当一个单元被轻敲时我正在这样做:
CGPoint pointInCollectionView = [gesture locationInView:self.collectionView];
NSIndexPath *selectedIndexPath = [self.collectionView indexPathForItemAtPoint:pointInCollectionView];
UICollectionViewCell *selectedCell = [self.collectionView cellForItemAtIndexPath:selectedIndexPath];
NSLog(@"Selected cell %@", selectedIndexPath);
Run Code Online (Sandbox Code Playgroud)
不确定从哪里开始.应该UICollectionView负责显示放大的细胞吗?或者我应该创建一个新的视图控制器,以全屏显示单元格(图像)的内容?
我正在尝试使用全屏api.API可以正常运行所有其他浏览器,但不幸的是ie11没有响应.我正在使用此处复制的代码:
var element = $doc.documentElement;
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;
if (requestMethod)
{ // Native full screen.
console.log(requestMethod);
requestMethod.call(element);
}
else if (requestMethod !== "undefined")
{ // Older IE.
console.log("window.ActiveXObject !== undefined");
var wscript = new ActiveXObject("Wscript.shell");
wscript.SendKeys("{F11}");
}
Run Code Online (Sandbox Code Playgroud)
有什么建议?
为了支持位置:css-layout中的"fixed"(react-native),
使用案例:我有(很多)视频深度嵌套在视图层次结构中 - 想想视频列表,其中任何一个我想全屏.
当前方法(hack):使视频视图与屏幕一样大(css样式中高度宽度的固定值),跟踪视频视图的父布局位置,并为视频提供负边距以正确显示.
期望的方法:想知道是否有一种简单的方法可以做到这一点(如位置:固定)
欢迎任何建议或帮助
我正在使用VueJS开发PWA。我开始在真实设备(添加到主屏幕)中测试我的应用程序。我的应用程序打算达到100%的高度,因为它显示了一张地图,如您所见:
似乎有时,从视口高度外部出现的过渡会使地址栏出现在页面顶部。对于PWA,我认为这种行为使应用程序看起来不太自然,并且破坏了我的设计(除非用户手动关闭地址栏,否则不显示底部中心的按钮和整个地图容器)。
我尝试了在其他问题中看到的一些事情:
window.scrollTo(0, 1);<meta name="mobile-web-app-capable" content="yes"> 我不在乎该应用程序在网络浏览器中访问时是否不隐藏地址栏。但是至少当我将应用程序作为“本机”应用程序启动时(添加到主屏幕),我希望地址栏隐藏。
我也尝试改变display在物业manifest.json从standalone到fullscreen没有运气。
我知道我可以更改按钮和地图的css以便在地址栏可见时使它们“可见”,但是正如我说的那样,这使该应用程序不太像IMO。
有没有永久隐藏地址栏的解决方案?在设计中是否有可能或必须考虑?
我正在尝试创建一个C#应用程序,它将控制游戏.我试图做的是例如:按住A键150ms,按住左箭头500ms,依此类推.我经常搜索,我发现了以下代码.我的程序首先瞄准游戏,然后拿着钥匙.
I'm holding the keys this way:
Keyboard.HoldKey(Keys.Left);
Thread.sleep(500);
Keyboard.ReleaseKey(Keys.Left);
Run Code Online (Sandbox Code Playgroud)
这是Keyboard类:
public class Keyboard
{
public Keyboard()
{
}
[StructLayout(LayoutKind.Explicit, Size = 28)]
public struct Input
{
[FieldOffset(0)]
public uint type;
[FieldOffset(4)]
public KeyboardInput ki;
}
public struct KeyboardInput
{
public ushort wVk;
public ushort wScan;
public uint dwFlags;
public long time;
public uint dwExtraInfo;
}
const int KEYEVENTF_KEYUP = 0x0002;
const int INPUT_KEYBOARD = 1;
[DllImport("user32.dll")]
public static extern int SendInput(uint cInputs, ref Input inputs, int cbSize);
[DllImport("user32.dll")]
static …Run Code Online (Sandbox Code Playgroud) 我想在用户锁定设备后立即在 Android 外观屏幕上显示一份简短的调查问卷。为此,我检测屏幕锁定事件并显示带有全屏意图通知的活动。
val fullScreenIntent = Intent(context, destination)
fullScreenIntent.flags = Intent.FLAG_ACTIVITY_NO_HISTORY or
Intent.FLAG_ACTIVITY_CLEAR_TASK or
Intent.FLAG_ACTIVITY_CLEAR_TOP or
Intent.FLAG_ACTIVITY_NEW_TASK
val fullScreenPendingIntent = PendingIntent.getActivity(context, 0, fullScreenIntent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
val builder = NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(R.drawable.ic_logo)
.setContentTitle(title)
.setContentText(description)
.setFullScreenIntent(fullScreenPendingIntent, true)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_ALARM)
with(notificationManager){
createNotificationChannel()
val notification = builder.build()
notify(NOTIFICATION_ID, notification)
}
Run Code Online (Sandbox Code Playgroud)
为了让活动显示在外观屏幕上,我在OnCreate调查问卷活动的方法中执行此操作:
fun Activity.turnScreenOnAndKeyguardOff() {
setShowWhenLocked(true)
setTurnScreenOn(true)
with(getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager) {
requestDismissKeyguard(this@turnScreenOnAndKeyguardOff, null)
}
}
Run Code Online (Sandbox Code Playgroud)
在清单中:
<activity
android:name="com.example.trackingapp.activity.LockActivity"
android:exported="true"
android:launchMode="singleTop"
android:showOnLockScreen="true"
android:excludeFromRecents="true"/>
Run Code Online (Sandbox Code Playgroud)
这适用于 Android 9、10 和 11 以及某些 Android 12 (Pixel 3) …
android fullscreen lockscreen android-notifications keyguard
fullscreen ×10
c# ×2
javascript ×2
android ×1
css ×1
html5 ×1
ios ×1
java ×1
javafx-2 ×1
jquery ×1
key ×1
key-bindings ×1
keyguard ×1
keylistener ×1
keyup ×1
layout ×1
lockscreen ×1
objective-c ×1
react-native ×1
swing ×1
zoom ×1