我需要有两个不同版本的同一个文件 - 一个在本地机器上,一个在服务器(repo)上。
我已将文件放入.gitignore,但现在在每次推送期间,它将删除存储库中的文件。
如何防止删除 repo 上的文件?谢谢!
我想将Material-ui TextField设置为只读(未禁用),文本与中心和隐藏的cursos对齐.我用
style={{ textAlign: 'center', cursor: 'none' }}
Run Code Online (Sandbox Code Playgroud)
但这没有效果.
谢谢你的解决方案.
我制作RN应用。对于Android版本,我使用以下内容制作了/drawable/splash_screen.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@color/gray"/>
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/ic_launcher"/>
</item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)
并在res / values / styles.xml中链接到此文件
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
</style>
Run Code Online (Sandbox Code Playgroud)
也在AndoirdManifest.xml中
<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/SplashTheme"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
Run Code Online (Sandbox Code Playgroud)
这可以正常工作,但我想制作SVG文件而不是PNG(mipmap / ic_launcher)。SVG文件可能是这样的 https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html (至少没有动画)。如何实现呢?
将Android SDK文件夹移动到另一个位置后,Genymotion(v 2.9.0)在设置 - > ADB下显示警告"此位置未找到AAPT工具",并在Android设备启动时在弹出对话框中显示空位置.
我需要修理什么以及如何修复?
谢谢
我做简单屏幕只包含一个带占位符的TextInput,但显示占位符.怎么了?
MyComponent的:
render() {
<TextInput
placeHolder="placeholder"
/>
}
Run Code Online (Sandbox Code Playgroud)
index.js:
export default () => {
<MyComponent />
}
Run Code Online (Sandbox Code Playgroud)
将TextInput包装到View中无济于事.
我想让View在不同尺寸(对于Android 4+)和dpi(240+)以及iPhone 4+和iPad上看起来一样。当我定义尺寸时,例如 270x65,它在640 dpi的屏幕上看起来比在320 dpi的屏幕(2560x1600实际屏幕尺寸)上相同尺寸大一倍。
这是一个好的解决方案吗?
containerButton: {
width: calcDimension(270),
height: calcDimension(65)
}
const calcDimension = size =>
size / (screenScale() > 2 ? (screenScale() / 2) : 1);
const screenScale = () =>
(Dimensions.get('window').scale);
Run Code Online (Sandbox Code Playgroud)
还是有更好的解决方案?谢谢。
react-native ×3
javascript ×2
android ×1
genymotion ×1
git ×1
gitignore ×1
material-ui ×1
node.js ×1
reactjs ×1
svg ×1