草庐IT

show-hide

全部标签

具有可见性的 android 布局 GONE

四个View使用相同的xml。我只想显示view1的线性布局。我把android:visibility="gone"放在xml中。然后我为view1-执行以下操作LinearLayoutlayone=(LinearLayout)view.findViewById(R.id.layone);layone.setVisibility(View.VISIBLE);但这并没有将可见性设置为可见。在xml中声明GONE后是否可以显示View?我不想通过做来转换逻辑,layone.setVisibility(View.GONE);在除View1之外的三个View中。想法或评论?更新:我的xml-

android:load svg file from web and show it on image view

我想从网上加载一个svg文件并在ImageView中显示这个文件。对于非矢量图像,我使用Picasso图书馆。是否也可以将此库用于svg文件?有没有办法从网络上加载svg文件并在ImageView中显示?我使用svg-android显示svg文件的库,但我不知道如何从网络获取svg图像,该库的所有示例都使用本地文件。 最佳答案 更新:如需更新版本,请查看Glide示例(https://github.com/bumptech/glide/tree/master/samples/svg)-您可以使用Glide(https://githu

android:load svg file from web and show it on image view

我想从网上加载一个svg文件并在ImageView中显示这个文件。对于非矢量图像,我使用Picasso图书馆。是否也可以将此库用于svg文件?有没有办法从网络上加载svg文件并在ImageView中显示?我使用svg-android显示svg文件的库,但我不知道如何从网络获取svg图像,该库的所有示例都使用本地文件。 最佳答案 更新:如需更新版本,请查看Glide示例(https://github.com/bumptech/glide/tree/master/samples/svg)-您可以使用Glide(https://githu

android - setImeOptions : why the "Done" button does not show on the soft keyboard?

我尝试使用input.setImeOptions(EditorInfo.IME_ACTION_DONE)设置软键盘上的“完成”按钮;但“完成”按钮根本不显示在软键盘上。有什么建议吗?publicvoidmodif(intposition){AlertDialog.Builderalert=newAlertDialog.Builder(MainActivity.this);alert.setTitle("Modifica");EditTextinput=newEditText(MainActivity.this);input.setImeOptions(EditorInfo.IME_AC

android - setImeOptions : why the "Done" button does not show on the soft keyboard?

我尝试使用input.setImeOptions(EditorInfo.IME_ACTION_DONE)设置软键盘上的“完成”按钮;但“完成”按钮根本不显示在软键盘上。有什么建议吗?publicvoidmodif(intposition){AlertDialog.Builderalert=newAlertDialog.Builder(MainActivity.this);alert.setTitle("Modifica");EditTextinput=newEditText(MainActivity.this);input.setImeOptions(EditorInfo.IME_AC

Android:显示/隐藏状态栏/电源栏

我正在尝试创建一个按钮,我可以在其中隐藏或显示平板电脑上的状态栏。我已经加入了onCreategetWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);在按钮中显示:WindowManager.LayoutParamsattrs=getWindow().getAttributes();attrs.flags&=~WindowManager.LayoutParams

Android:显示/隐藏状态栏/电源栏

我正在尝试创建一个按钮,我可以在其中隐藏或显示平板电脑上的状态栏。我已经加入了onCreategetWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);在按钮中显示:WindowManager.LayoutParamsattrs=getWindow().getAttributes();attrs.flags&=~WindowManager.LayoutParams

android - 从 onRequestPermissionsResult() 中调用 DialogFragment 的 show() 会导致 Marshmallow 中出现 IllegalStateException

步骤:向Fragment或Activity请求权限在onRequestPermissionsResult()中显示一个DialogFragmentjava.lang.IllegalStateExceptionisthrow:CannotperformthisactionafteronSaveInstanceState当我在延迟一段时间后显示对话框(使用postDelayed)时,不会发生这种情况。根据http://www.androiddesignpatterns.com/2013/08/fragment-transaction-commit-state-loss.html)在后蜂窝设

android - 从 onRequestPermissionsResult() 中调用 DialogFragment 的 show() 会导致 Marshmallow 中出现 IllegalStateException

步骤:向Fragment或Activity请求权限在onRequestPermissionsResult()中显示一个DialogFragmentjava.lang.IllegalStateExceptionisthrow:CannotperformthisactionafteronSaveInstanceState当我在延迟一段时间后显示对话框(使用postDelayed)时,不会发生这种情况。根据http://www.androiddesignpatterns.com/2013/08/fragment-transaction-commit-state-loss.html)在后蜂窝设

android - libpng 错误 : Not a PNG file Error Showing In Android Studio

我刚刚将一个项目从Ecipe导入到AndroidStudio。只是一个简单的项目。但是项目文件夹显示一个错误。我可以知道实现目标的正确方法是什么吗?我是Android-studio的新手。有人遇到这个问题吗?任何帮助将不胜感激。这里是Logcat:Executionfailedfortask':app:mergeDebugResources'.>Error:Failedtoruncommand:/home/amiya/android-studio/sdk/build-tools/android-4.4.2/aapts-i/home/amiya/vola/app/src/main/res