你好,哈哈

iHTCboy
Posted 4 months, 4 weeks ago in General, viewed 352 times

原因:项目中横竖屏的配置或代码选择支持上不匹配实际方向。 解决:检查下面几种情况:

1、正确代码:

def get_topic_ordering(request):
    query_order = request.GET.get("order", "")
    if query_order in ["-last_replied", "last_replied", "pub_date", "-pub_date"]:
         return query_order
    return get_default_ordering()

2、保证项目的Info.plist 文件中字段 View controller-based status bar appearance 设置为 NO

3 Replies
  • iHTCboy
    4 months, 4 weeks ago

    更新,2019年后,苹果更新 Xcode10,后,需要补充更新:

    // 支持设备自动旋转
    - (BOOL)shouldAutorotate {
        return NO;
    }
    
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
        return NO;
    }
    
    // 支持横屏显示
    - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
        // 如果该界面需要支持横竖屏切换
        return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
    }
    

  • iHTCboy
    4 months, 4 weeks ago

    @iHTCboy

    测试一下,感觉很棒!谢谢开源!谢谢作者~

  • iHTCboy
    4 months, 4 weeks ago

    沙发:

    Django-NIJI is a pluggable forum app for Django projects.
    
    Demo
    
    https://demo.nijiforum.com/
    Docs
    
    http://django-niji.rtfd.io
    

Leave a Reply
NIJI APP
NIJI is a forum app built with Django

General

General discussions about Django, Python, Nijiforum etc.