Questions tagged «android»

Android是Google的移动操作系统,用于对数字设备(智能手机,平板电脑,汽车,电视,Wear,Glass和IoT)进行编程或开发。对于与Android相关的主题,请使用特定于Android的标签,例如android-intent,android-activity,android-adapter等。对于与开发或编程无关但与Android框架相关的问题,请使用以下链接:https:// android.stackexchange.com。

6
Android-文字阴影?
我想知道如何在android中的文本上添加阴影? 我将以下代码应用于位图,并且希望对其进行阴影处理... paint.setColor(Color.BLACK); paint.setTextSize(55); paint.setFakeBoldText(false); paint.setShadowLayer(1, 0, 0, Color.BLACK); //This only shadows my whole view...
184 android 

7
在Mac上找到Android SDK并添加到PATH
我已经在MacBook Air(操作系统版本10.11 El Capitan)上安装了Android Studio,并成功编写了一个小型的“ hello,world”应用程序,并已安装在设备(Nexus 7)上,并在AVD上运行。我现在要做的就是能够从命令行(而不是Android Studio)构建应用程序并将其安装在设备上。我正在按照以下指示进行操作: http://developer.android.com/training/basics/firstapp/running-app.html 和相关的行是: 确保PATH环境变量中包含Android SDK platform-tools /目录,然后执行: 问题是我在机器上找不到Android SDK!我认为它在那里是因为否则程序将无法编译并通过Android Studio运行?也许那是一个错误的假设?我是Mac的新手(我曾经使用过Windows),所以我不知道搜索Android SDK的最佳方法。所以我的问题是: 如何在机器上找到Android SDK?还是向自己证明它不存在? 如果不存在,该如何安装? 如何更改PATH以包括Android SDK?



17
Android:为什么视图没有maxHeight?
视图有一个,minHeight但不知为何缺少一个maxHeight: 我想要达到的目的是要填充一些项目(视图)ScrollView。当有1..3项目时,我想直接显示它们。表示ScrollView的高度为1、2或3个项目。 当有4个或更多项目时,我希望ScrollView停止扩展(因此为maxHeight)并开始提供滚动。 但是,很遗憾,无法设置maxHeight。因此,我可能必须以ScrollView编程方式将高度设置为WRAP_CONTENT存在1..3项时的高度,或者将高度设置为3*sizeOf(View)存在四个或更多项时的高度。 任何人都可以解释为什么已经没有maxHeight提供了minHeight吗? (顺便说一句:有些视图,例如ImageView已maxHeight实现。)

16
如何在Android中删除按钮周围的填充?
在我的Android应用中,我具有以下布局: <?xml version="1.0" encoding="utf-8" ?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" class="com.google.android.gms.maps.SupportMapFragment"/> <Button android:id="@+id/button_back" android:layout_width="fill_parent" android:layout_height="wrap_content" android:onClick="CloseActivity" android:padding="0dp" android:text="@+string/back" /> </LinearLayout> 在预览中和在电话上,它看起来像: 正如您在底部区域的按钮上看到的那样,那里有一些填充。 如何消除这种情况,让按钮完全填满底部区域?
184 java  android  button 


9
Android选择器和文字颜色
我想要一个简单TextView的运行方式simple_list_item_1在ListView做。这是XML: <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center" android:focusable="true" android:minHeight="?android:attr/listPreferredItemHeight" android:textAppearance="?android:attr/textAppearanceLarge" android:background="@android:drawable/list_selector_background" /> 一切正常,除了在预期状态下不会改变的文字颜色。我如何将其更改为textAppearanceLargeInverse?


11
无法在Android Studio中使用小写按钮文字
我有一个琐碎的问题困扰了我一段时间。我尝试用谷歌搜索,但是似乎没有人遇到与我相同的问题,或者没有人将其视为问题。当我在activity_my.xml中的布局下创建按钮时 <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/button_1_name" android:id="@+id/button2" android:layout_marginTop="140dp" android:layout_below="@+id/textView" android:layout_centerHorizontal="true" /> 我得到一个看起来像的按钮 即使我的字符串代码是: <resources> <string name="app_name">HelloWorld</string> <string name="hello_world">Hello world!</string> <string name="action_settings">Settings</string> <string name="button_1_name">BuTtOn 1</string> 我知道我肯定在这里缺少一些小东西,但是如何在按钮文本中使用小写/大写呢? 谢谢!


8
无需安装apk即可获取Android .apk文件VersionName或VersionCode
下载并没有安装后,如何从AndroidManifest.xml文件中以编程方式获取我的apk的版本代码或版本名称。 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="xxx.xx.xxx" android:versionCode="1" android:versionName="1.1" > 例如,我要检查是否在我的IIS服务上上传了新版本,将其安装在设备上之后,如果它不是新版本,则我不想安装它。



26
Android完全透明的状态栏?
我已经搜索了文档,但只发现了以下内容: Link。哪个用于使条形图半透明?我想做的是使状态栏完全透明(如下图所示),并使其向后兼容APK <19: 我的styles.xml: <resources xmlns:tools="http://schemas.android.com/tools"> <style name="AppTheme" parent="Theme.AppCompat.Light"> <item name="android:actionBarStyle">@style/ThemeActionBar</item> <item name="android:windowActionBarOverlay">true</item> <!-- Support library compatibility --> <item name="actionBarStyle">@style/ThemeActionBar</item> <item name="windowActionBarOverlay">true</item> </style> <style name="ThemeActionBar" parent="Widget.AppCompat.Light.ActionBar.Solid"> <item name="android:background"> @null </item> <!-- Support library compatibility --> <item name="background">@null</item> <item name="android:displayOptions"> showHome | useLogo</item> <item name="displayOptions">showHome|useLogo</item> </style> </resources> 我能做的是:
183 android  statusbar 

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.