大约有 3,621 项符合查询结果(耗时:0.0176秒) [XML]
How to get the ActionBar height?
...r height
TypedValue tv = new TypedValue();
if (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))
{
Int actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());
}
Kotlin:
val tv = TypedValue()
if (requireActivity().theme.resolveAt...
MVC pattern on Android
...it possible to implement the model–view–controller pattern in Java for Android?
21 Answers
...
Fragment is not being replaced but put on top of the previous one
...
The android developer site suggests the use of a FrameLayout to load fragments dynamically at run-time. You have hard-coded the fragment in your xml file. So it cannot be removed at run-time as mentioned in this link:
http://dev...
Android WebView: handling orientation changes
...fig){
super.onConfigurationChanged(newConfig);
}
And set the android:configChanges attribute in the manifest:
<activity android:name="..."
android:label="@string/appName"
android:configChanges="orientation|screenSize"
for more info see:
http://developer.androi...
How to display a Yes/No dialog box on Android?
... difficult (well, at least not programmer-friendly) to display a dialog in Android.
17 Answers
...
How do I set the rounded corner radius of a color drawable using xml?
On the android website, there is a section about color drawables . Defining these drawables in xml looks like this:
3 Ans...
First letter capitalization for EditText
...
Statically (i.e. in your layout XML file): set android:inputType="textCapSentences" on your EditText.
Programmatically: you have to include InputType.TYPE_CLASS_TEXT in the InputType of the EditText, e.g.
EditText editor = new EditText(this);
editor.setInputType(InputT...
What's “tools:context” in Android layout files?
...
i see . according to the screenshot here : tools.android.com/_/rsrc/1337185954574/recent/newconfigchooser/… , it means that doesn't have to be a class that extends Context , right? if so, i think it does more that what you are saying , though i'm not sure what .
...
Soft keyboard open and close listener in an activity in Android
...
This only works when android:windowSoftInputMode of your activity is set to adjustResize in the manifest. You can use a layout listener to see if the root layout of your activity is resized by the keyboard.
I use something like the following bas...
Change Image of ImageView programmatically in Android
...
Use in XML:
android:src="@drawable/image"
Source use:
imageView.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.your_image));
share
...