草庐IT

hide-button

全部标签

android - 超过 3 个项目的底部导航 View : tab title is hiding

我正在使用带有Android支持设计库25的BottomNavigationView。但是当我切换标签时,另一个标签的标题被隐藏了。但实际底部导航View没有隐藏问题。但我的藏起来了。但我希望它看起来像那样。有什么想法吗?我错过了什么?这是我的代码:activity_main.xmlbottom_bar_menu.xml 最佳答案 使用反射的解决方案不再起作用,因为字段mShiftingMode已被删除。现在有一个简单的方法:使用支持库28或更高版本,只需将app:labelVisibilityMode="labeled"添加到您的

android - Button with image, ImageButton, and clickable ImageView的区别?

Buttonwithimage,ImageButton和clickableImageView有什么区别吗? 最佳答案 这可能只涵盖了部分差异,实际查看Android源代码树以了解发生了什么会有所帮助。ImageButtons具有推送状态,而可点击图像则没有。你也不能为ImageButton调用setText,你可以用一个普通的按钮。它们都来自View,但查看以下扩展链可能会有所帮助。java.lang.Object↳android.view.View↳android.widget.ImageView↳android.widget.I

android - 检索项目 : No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored' 的父项时出错

我在androidstudio中启动新项目时收到这些错误。Error:(1)Errorretrievingparentforitem:Noresourcefoundthatmatchesthegivenname'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.Error:(1)Errorretrievingparentforitem:Noresourcefoundthatmatchesthegivenname'android:TextAppearance.Material.Widget.Button.B

android - 如何同时为 Button 应用形状和选择器?

我为按钮应用了一个形状,例如:现在我想使用如下选择器:对于这个按钮也是如此。有没有可能……??? 最佳答案 这样使用:........................... 关于android-如何同时为Button应用形状和选择器?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/7606995/

android - Android 源代码中的@hide 是什么意思?

对于Activitysourcecode,第3898行(靠近底部):/***@hide*/publicfinalbooleanisResumed(){returnmResumed;}@hide是什么意思?我发现我的publicclassChildActivityextendsActivity{...}无法使用/查看Activity.isResumed()。这是正常的吗?如何访问它? 最佳答案 Android有两种无法通过SDK访问的API。第一个位于com.android.internal包中。第二种API类型是用@hideJava

Android fragment : When to use hide/show or add/remove/replace?

假设我希望将某个容器View中的当前fragment替换为另一个。是不是用replace更好...FragmentTransactionft=getSupportFragmentManager().beginTransaction();ft.replace(R.id.fragment_container,newFragment,null);ft.commit();...或以下,显示和隐藏?FragmentTransactionft=getSupportFragmentManager().beginTransaction();ft.hide(oldFragment);ft.show(ne

android - 如何在 Android 中捕获 "virtual keyboard show/hide"事件?

我想根据是否显示虚拟键盘来更改布局。我搜索了API和各种博客,但似乎找不到任何有用的东西。有可能吗?谢谢! 最佳答案 2020年更新这现在是可能的:在Android11上,您可以这样做view.setWindowInsetsAnimationCallback(object:WindowInsetsAnimation.Callback{overridefunonEnd(animation:WindowInsetsAnimation){super.onEnd(animation)valshowingKeyboard=view.rootW

android - 为什么我的 Button 文本在 Lollipop 上强制全部大写?

在我的应用“TideNowWA”中,我最近使用它测试了兼容性新的Nexus9平板电脑(Lollipop-API21)。它会写一些按钮文本。此应用程序使用Android2.3和Android正确写入文本4.0。IE。混合大写和小写字母。当我的Nexus9上运行相同的应用程序时,所有字母文中大写。FWIW我的list包含以下语句:uses-sdkandroid:minSdkVersion="10"android:targetSdkVersion="14"我可以在我的代码中修复这个问题还是操作系统中的错误?谢谢 最佳答案 我不知道为什么会

python - 如何将参数传递给 Tkinter 中的 Button 命令?

假设我在Python中使用Tkinter制作了以下Button:importTkinterasTkwin=Tk.Toplevel()frame=Tk.Frame(master=win).grid(row=1,column=1)button=Tk.Button(master=frame,text='press',command=action)当我按下按钮时会调用方法action,但是如果我想将一些参数传递给方法action怎么办?我已尝试使用以下代码:button=Tk.Button(master=frame,text='press',command=action(someNumber)

java - 是否可以使用 android :DrawableRight? 在 Buttons 和 TextViews 中使用 VectorDrawable

当我在textview或imageview中使用VectorDrawable资源时,在使用“android:DrawableRight”/“android:DrawableEnd”/“android:DrawableStart”/“android:DrawableLeft”时会出现运行时崩溃。应用程序可以正常编译,不会出现任何警告。我正在使用Gradle1.5支持库23.2('com.android.support:appcompat-v7:23.2.0')但我发现,我可以在Java中以编程方式分配SVG,而不会发生这样的崩溃。TextViewtv=(TextView)findView