Thursday, August 9, 2012

Android - Placing Image Above Text in Button


Place the following in your layout XML file, replacing [image] with your image:
1
2
3
4
5
6
<Button
     android:id="@+id/groups_button_bg"
     android:layout_height="wrap_content"
     android:layout_width="wrap_content"
     android:text="Groups"
     android:drawableTop="@drawable/[image]" />
Using android:drawableTop="@drawable/...", we’re able to place an image abovethe button text. The following options are available for placing the image in different positions relative to the button text:
1
2
3
4
android:drawableLeft
android:drawableRight
android:drawableBottom
android:drawableTop
In addition, android:drawablePadding can be used to specify the amount of padding between the image and button text.

Getting RAW Soap Data from a Web Reference Client running in ASP.NET

Just add the following line in your web.config file after "authentication" section


 <system.diagnostics>
    <trace autoflush="true"/>
    <sources>
      <source name="System.Net" maxdatasize="1024">
        <listeners>
          <add name="TraceFile"/>
        </listeners>
      </source>
      <source name="System.Net.Sockets" maxdatasize="1024">
        <listeners>
          <add name="TraceFile"/>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add name="TraceFile" type="System.Diagnostics.TextWriterTraceListener"
        initializeData="trace.log"/>
    </sharedListeners>
    <switches>
      <add name="System.Net" value="Verbose"/>
      <add name="System.Net.Sockets" value="Verbose"/>
    </switches>
  </system.diagnostics>