以下是我在互联网上找到的一些代码:
class M?{public static void main(String[]a?){System.out.print(new char[]
{'H','e','l','l','o',' ','W','o','r','l','d','!'});}}
Run Code Online (Sandbox Code Playgroud)
此代码打印Hello World!
到屏幕上; 你可以看到它在这里运行.我可以清楚地看到public static void main
写作,但它是倒退的.这段代码是如何工作的?这甚至如何编译?
编辑:我在IntellIJ中尝试了这个代码,它运行正常.但是,由于某种原因,它在记事本++和cmd中都不起作用.我仍然没有找到解决方案,所以如果有人这样做,请在下面评论.
首先我知道这个问题出现在此之前,但在尝试了很多之后我仍然没有成功.我从Android Developers网站开始研究这个例子 .
我正在尝试将菜单设置为从右到左打开,而不是在示例中如何实现(从左到右).此外,我想将打开菜单按钮移动到操作栏的右侧.我也在这里提出了一些答案,例如在这个答案中.
我尝试改变视图和布局的重力,但我得到错误:
没有抽屉视图发现绝对重力LEFT
你可以帮我弄清楚我的代码中有什么问题,为了设置菜单从右边打开,我应该改变什么,并将操作栏按钮移动到右侧?
xml代码在这里:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_gravity="right"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/content_frame"
android:layoutDirection="rtl"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<ListView android:id="@+id/left_drawer"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="10dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud) 就在最近的context.getResources().updateConfiguration()已在Android API 25中弃用,建议使用上下文.而是createConfigurationContext().
有谁知道createConfigurationContext如何用于覆盖android系统区域设置?
在此之前将通过以下方式完成:
Configuration config = getBaseContext().getResources().getConfiguration();
config.setLocale(locale);
context.getResources().updateConfiguration(config,
context.getResources().getDisplayMetrics());
Run Code Online (Sandbox Code Playgroud) 除了针对所有RTL语言测试语言代码之外,还有办法识别RTL(从右到左)语言吗?
由于API 17+为RTL和LTR提供了多种资源,我认为应该有一种方法,至少从API 17开始.
这是一个非常直截了当的问题,但是我无法在SO上找到明确的答案(如果我错过了,请纠正我).
基本上,我的问题是:是否可以UICollectionView
从右到左而不是从左到右对齐行内容?
在我的研究中,我看到了建议子类化的答案UICollectionViewFlowLayout
,但我还没有找到一个为右对齐创建一个例子的例子.
我的目标是设置2个集合视图,如下所示:
任何帮助是极大的赞赏!
objective-c right-to-left ios uicollectionview uicollectionviewlayout
我的应用程序使用UITextView输入Syriac文本(Estrangelo字体),但是UITextView会像这样错误地呈现一些字母:
我用UILabel和UITextView测试了它.UILabel正确显示它,但UITextView错误地显示顶部点并将它们移动到底部(参见上面的结果).
此问题仅发生在iOS 7中,并且不会发生在iOS 6中.请告诉我是否有任何方法可以解决问题.
这是我的测试代码
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
label.center = CGPointMake(self.view.center.x, self.view.center.y-40);
label.font = [UIFont fontWithName:@"East Syriac Adiabene" size:24];
label.text = @"?? ?? ?? ??";
[self.view addSubview:label];
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
textView.center = CGPointMake(self.view.center.x, self.view.center.y+40);
textView.font = [UIFont fontWithName:@"East Syriac Adiabene" size:24];
textView.text = @"?? ?? ?? ??";
[self.view addSubview:textView];
Run Code Online (Sandbox Code Playgroud) 我想在TextView中用(从右到左的语言,即阿拉伯语)编写文本.但我想让文字从右到左书写方向.gravity:right
将文本对齐.我想从右到左证明文本的合理性(使单词和数字出现在他按行输入的顺序中).怎么样 ?
是否有任何现有的降价规范,包括对RTL语言的支持?
我希望的是类似的东西
This paragraph is left to right
<- This paragraph is right to left
Run Code Online (Sandbox Code Playgroud)
或者某些东西......我可以调整我的解析器来处理这个但我想确保它已经不存在了.
我刚刚发现Twitter Bootstrap,我想知道它是否有从右到左(RTL)版本.有人知道吗?
<div style="direction: rtl">
[x]y
</div>
Run Code Online (Sandbox Code Playgroud)
您可以看到HTML文本[x]y
显示为x]y]
.
这个结果是什么原因?
PS:我在Chrome 56.0.2924.87(64位)中得到了这个结果.
right-to-left ×10
android ×4
css ×2
arabic ×1
custom-font ×1
html ×1
ios ×1
ios7 ×1
java ×1
locale ×1
markdown ×1
multilingual ×1
objective-c ×1
persian ×1
textview ×1
uitextview ×1
unicode ×1