I have develop app in which I set layout 480 * 320, it is starting from top. But my problem is there is one in build border are display when we take a new project and it is display in all activity. So I want to disable it.
Border like
So can you tell how can I remove it or hide it?
I think what you are trying to do is hide the TitleBar of the application. You can do that by changing the application theme.
Add android:theme="#android:style/Theme.Light.NoTitleBar" in the <application> tag of your manifest file.
Any theme with .NoTitleBar should do the trick.
use any one.
Manifest:
android:theme="#android:style/Theme.NoTitleBar"
Or
java:
requestWindowFeature(Window.FEATURE_NO_TITLE);
requestFeature(FEATURE_NO_TITLE);
in you activity's onCreate before setting the layout should remove it.
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
Related
Issue:
I have seen this overlap anytime I have a button under a textview or edittext. If I try to add text to one of these, the keyboard forces the buttons to raise. What causes this overlap and how can I avoid it?
Try android:windowSoftInputMode="adjustNothing" in your AndroidManifest.xml file for the activity you're using the layout, for example:
<activity
android:name=".MainActivity"
android:windowSoftInputMode="adjustNothing">
For more info go to the following link: http://developer.android.com/reference/android/R.attr.html#windowSoftInputMode
Change RelativeLayout to other type of layout or specify different android:windowSoftInputMode in your manifest for this activity.
I'm using the Eclipse GUI for android. I want to use the full screen and I'm searching for the attribute, that disables the edge in a theme. I'm using the NoTitleBar theme and a relative layout and I can't place buttons on the edgde of the screen. There are like 10pixels I can't reach. Something like item name="android:windowNoEdge" true /item. In addition I can't really make the views/buttons as big as i want, when I try to drag them too a different/bigger shape/size they just shrink back too the original shape/size.
Method 1:
Put this in your onCreate method
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
before setContentView()
Method 2:
This will make entire application to full-screen, instead of just one Activity.
<application
...
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
... >
I'm using ActionBarSherlock. windowSoftInputMode is adjustPan (I've tried with adjustResize and adjustNothing also).
I want to keep ActionBar on screen when keyboard appears but slide my layout instead (so text remains visible).
Here is how it looks right:
And when keyboard is appeared:
Question is: how can I keep ActionBar visible while using adjustPan (so EditTexts will always be visible)?
NOTE
I can't use ScrollView to hold my View
I find out, that there may be problems with adjustResize (for some reason it's just uses adjustPan instead) when you applying FLAG_FULLSCREEN to Window of Activity:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Without this line resizing working just fine.
it looks like the layout slides up to make some space for the keyborad try:
add this to your manifest.xml:
<activity android:name=".YourActivity" android:label="#string/app_name" android:configChanges="keyboardHidden|orientation|keyboard" />
the important part is:
android:configChanges="keyboardHidden|orientation|keyboard"
android documentation manifest.xml
I am new to implement the ListView with section.
I have use this application to implement the section to my list view.
Now I want to add the Titlebar that display the application page title. Then where do I have to make a change? In the xml file or in the Java file?
Please refer the example and let me tell what should I have to change to make Titlebar for my app.
Try this...
final Activity activity = this;
activity.setTitle("Settings");
if you disabled the title bar using, this.requestWindowFeature(Window.FEATURE_NO_TITLE);
remove it.
(OR)
Try this..
final Activity activity = this;
this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.settings);
activity.setTitle("Settings");
There are two ways to change title bar for your activity:
Design time (that is, change title in AndroidManifest.xml file).
By coding (that is, you can code to change the activity title).
Example for 1st:
you can Change the Title of each screen (i.e. Activity) by setting their Android:label inside the AndroidManifest.xml file:
<activity android:name=".Hello_World"
android:label="This is the Hello World Application">
</activity>
And yes, to display customized title bar for your activity, go through this answer: How to change the text on the action bar
In your AndroidManifest.xml file you have a section for each activity that looks like this
<activity
android:label="Your Activity"
android:name=".YourActivity" />
where the android:label tag defines what the text in the titlebar is.
I declared a dialog activity in my Manifest as follows:
<activity android:name=".myDialog"
android:label="#string/title_dlg"
android:icon="#android:drawable/ic_dialog_alert"
android:exported="false"
android:excludeFromRecents="true"
android:theme="#android:style/Theme.Dialog">
However, only the title's text appears in the title bar and the icon appears to be ignored.
Is there a way to also show the icon in the title bar?
Use this after your super.onCreate(savedInstanceState); call:
requestWindowFeature(Window.FEATURE_LEFT_ICON);
Then, set your contentView(R.layout.youLayout);
and then use this:
getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, android.R.drawable.ic_dialog_alert);
The order is important.
I think using below line after super call will work
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
Keep in mind to place it before setting content view